Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const build = 1807170;
- var version;
- var showSideMenu;
- var hideSideMenu;
- (function() {
- function func(n, r, event) {
- if (!n) {
- return;
- }
- var total = this["location"]["href"]["split"]("://")[1]["split"]("/")[0]["split"](":")[0];
- var nextIdLookup = n["split"](",");
- var indexLookupKey = 0;
- for (; indexLookupKey < nextIdLookup["length"]; indexLookupKey++) {
- var currentIndex = nextIdLookup[indexLookupKey];
- if (currentIndex == total) {
- return;
- }
- if (!r) {
- continue;
- }
- currentIndex = total["split"]("." + currentIndex);
- if (currentIndex["length"] == 2 && !currentIndex[1]) {
- return;
- }
- }
- throw event || "error";
- }
- function f(value) {
- var locationMap = $("#" + value);
- if (locationMap["css"]("display") == "none") {
- startUpload();
- locationMap["show"](500);
- }
- }
- function startUpload() {
- $("#main-right")["children"]()["each"](function() {
- if ($(this)["css"]("display") == "block") {
- $(this)["hide"](500);
- }
- });
- }
- function exports() {
- function refresh() {
- function clear(fn) {
- jQuery["ajax"]({
- type : "POST",
- dataType : "json",
- url : "https://gota.io/api/servers",
- success : function(d) {
- var n;
- for (n in d) {
- var year = d[n];
- var mainWord;
- for (mainWord in year) {
- var values = year[mainWord];
- var m02 = values["playersCurrent"] + "/" + values["maxPlayers"];
- graph[values["name"]] = new Matrix3(values["name"], values["address"], m02, values["gamemode"], n["toLowerCase"](), values["ssl"]);
- graph[values["name"]]["playersCurrent"] = values["playersCurrent"];
- }
- }
- removeaToolTip();
- if (fn != null) {
- fn();
- } else {
- if (children != null) {
- remove(children["name"]);
- }
- }
- },
- error : function(deleted_model) {
- removeaToolTip();
- }
- });
- }
- function getData() {
- jQuery["ajax"]({
- type : "POST",
- dataType : "json",
- url : "https://gota.io/api/region",
- success : function(result) {
- var gotExpectedDetails = result["continent"]["toLowerCase"]();
- ok(gotExpectedDetails);
- var node;
- for (node in graph) {
- if (graph[node]["region"] == gotExpectedDetails) {
- if (graph[node]["playersCurrent"] < 128) {
- remove(node);
- break;
- }
- }
- }
- },
- error : function(deleted_model) {
- ok("eu");
- remove("Vendetta");
- }
- });
- }
- function ajax() {
- jQuery["ajax"]({
- type : "GET",
- dataType : "jsonp",
- crossDomain : true,
- url : "https://gamedata.gota.io/skinData.php",
- data : {
- "action" : "get"
- },
- async : false,
- success : function(xhr) {
- var nextIdLookup = JSON["parse"](JSON["parse"](xhr["json"])["names"]);
- var indexLookupKey;
- for (indexLookupKey in nextIdLookup) {
- var currentIndex = nextIdLookup[indexLookupKey];
- array[currentIndex] = 1;
- }
- },
- error : function(header, text, msg) {
- console["log"](header);
- console["log"]("Text status: " + text);
- console["log"]("Error thrown: " + msg);
- }
- });
- }
- popcornVideo = document["getElementById"]("canvas");
- item = popcornVideo["getContext"]("2d");
- popcornMedia = document["getElementById"]("minimap-canvas");
- memo = popcornMedia["getContext"]("2d");
- items = $("#main");
- _attachmentCallbacks = $("#party-panel");
- hist = $(".hud-panel");
- payload = $("#score-panel");
- extendedRegExp = $("#main-scrimmage");
- elem = $("#context-menu");
- component = $("#chat-input");
- _messageListeners = $("#leaderboard-header");
- trans = $("#scrimmage-custom");
- refreshFilteredDataSource();
- $(window)["resize"](update_measurements);
- update_measurements();
- _0x5D95 = false;
- window["onmousemove"] = function(options) {
- self["mouseRawX"] = options["clientX"];
- self["mouseRawY"] = options["clientY"];
- };
- window["onkeydown"] = function(selector) {
- var count = selector["which"] || selector["keyCode"] || selector["charCode"];
- if (_0x5291) {
- render(count);
- selector["preventDefault"]();
- return;
- }
- if (component["is"](":focus")) {
- return;
- }
- if (count == 27) {
- wrap(items);
- if (startApp($("#popup-profile") || startApp($("#popup-account-username")))) {
- find($("#popup-profile"));
- find($("#popup-account-username"));
- }
- }
- if (items["css"]("display") != "none") {
- return;
- }
- if (count == params["kEjectMass"]) {
- _0x5D95 = true;
- } else {
- if (count == params["kSplit"]) {
- self["sendPacket"](new PaintTools["sendKey"](17));
- } else {
- if (count == params["kToggleSpec"]) {
- self["sendPacket"](new PaintTools["sendKey"](18));
- } else {
- if (count == params["kDoubleSplit"]) {
- self["sendPacket"](new PaintTools["sendKey"](17));
- self["sendPacket"](new PaintTools["sendKey"](17));
- } else {
- if (count == params["kTripleSplit"]) {
- var _0x4AB7 = 0;
- for (; _0x4AB7 < 3; _0x4AB7++) {
- self["sendPacket"](new PaintTools["sendKey"](17));
- }
- } else {
- if (count == params["kQuadSplit"]) {
- _0x4AB7 = 0;
- for (; _0x4AB7 < 4; _0x4AB7++) {
- self["sendPacket"](new PaintTools["sendKey"](17));
- }
- } else {
- if (count == 38) {
- self["mouseZoom"] *= 1.025;
- self["mouseZoom"] = self["mouseZoom"] > 3 ? 3 : self["mouseZoom"] < .25 ? .25 : self["mouseZoom"];
- } else {
- if (count == 40) {
- self["mouseZoom"] *= .975;
- self["mouseZoom"] = self["mouseZoom"] > 3 ? 3 : self["mouseZoom"] < .25 ? .25 : self["mouseZoom"];
- }
- }
- }
- }
- }
- }
- }
- }
- };
- window["onkeyup"] = function(selector) {
- var ourSignature = selector["which"] || selector["keyCode"] || selector["charCode"];
- if (ourSignature == params["kEjectMass"]) {
- _0x5D95 = false;
- }
- };
- $(document)["on"]("mousewheel", function(result) {
- if (items["css"]("display") == "none" && result["target"]["id"] == "canvas") {
- var _0x4A99 = result["originalEvent"]["wheelDelta"] || result["originalEvent"]["deltaY"] * -1;
- if (_0x4A99 > 0) {
- self["mouseZoom"] *= 1.1;
- } else {
- self["mouseZoom"] *= .9;
- }
- self["mouseZoom"] = self["mouseZoom"] > 3 ? 3 : self["mouseZoom"] < .25 ? .25 : self["mouseZoom"];
- }
- });
- document["addEventListener"]("contextmenu", function(params) {
- params["preventDefault"]();
- resolve(params);
- });
- rebuildAttributes();
- perform_graphics_ops();
- var workers = window["location"]["href"]["split"]("#")["slice"](1)["join"]("#")["split"]("&");
- var node = "";
- if (workers[0]) {
- node = workers[0]["toLowerCase"]();
- }
- if (workers[1]) {
- _self = workers[1];
- }
- var callback = null;
- if (node != null && node != "") {
- node = node[0]["toUpperCase"]() + node["slice"](1);
- callback = function() {
- if (graph[node] != null) {
- remove(node);
- ok(graph[node]["region"]);
- } else {
- getData();
- }
- };
- } else {
- callback = getData;
- }
- clear(callback);
- setInterval(function() {
- clear(null);
- }, 9E5);
- var cast_receivers = new StatusPage["page"]({
- page : "zln04k70r03y"
- });
- cast_receivers["summary"]({
- success : function(result) {
- $(".color-description")["text"](result["status"]["description"]);
- $(".color-dot")["addClass"](result["status"]["indicator"]);
- }
- });
- array = {};
- ajax();
- send();
- $(window)["unload"](scopeReadChanged);
- self = new Self;
- PaintTools = new Game;
- $("#cUiForegroundColor")["spectrum"]({
- color : values["interfaceForegroundColor"],
- showAlpha : true,
- change : function(newRangeElements) {
- updateSubmitButton();
- }
- });
- $("#cUiBackgroundColor")["spectrum"]({
- color : values["interfaceBackgroundColor"],
- showAlpha : true,
- change : function(newRangeElements) {
- updateSubmitButton();
- }
- });
- $("#cGameBackground")["spectrum"]({
- color : values["gameBackgroundColor"],
- change : function(newRangeElements) {
- updateSubmitButton();
- }
- });
- $("#cGridColor")["spectrum"]({
- color : values["gridColor"],
- showAlpha : true,
- change : function(newRangeElements) {
- updateSubmitButton();
- }
- });
- $("#cBorderColor")["spectrum"]({
- color : values["borderColor"],
- showAlpha : true,
- change : function(newRangeElements) {
- updateSubmitButton();
- }
- });
- bind();
- updateSubmitButton();
- init();
- minX = Date["now"]();
- fps = 0;
- self["selfMsg"]("Welcome to Gota.io!");
- if (meta["enabled"] && meta["motd"] !== "") {
- self["selfMsg"]("MOTD: " + meta["motd"]);
- }
- if (meta["enabled"] && meta["particles"] && !fields["cDisableEffects"] && !fields["cDisableEventSkins"]) {
- settings = new Store(meta["particlesMax"]);
- }
- parseFonts();
- window["requestAnimationFrame"](prepare);
- }
- function responseCacheControl(next, req) {
- var static_ip = "transparent";
- if (req) {
- static_ip = req["toHexString"]();
- $(next)["css"]("color", static_ip);
- }
- }
- function update_measurements() {
- popcornVideo["width"] = $(window)["width"]() * scale;
- popcornVideo["height"] = $(window)["height"]() * scale;
- }
- function updateSubmitButton() {
- if (fields["cUiEnabled"]) {
- getData();
- } else {
- $("#cUiForegroundColor")["spectrum"]("set", defaults["uiForeground"]);
- $("#cUiBackgroundColor")["spectrum"]("set", defaults["uiBackground"]);
- $("#cGameBackground")["spectrum"]("set", defaults["background"]);
- $("#cGridColor")["spectrum"]("set", defaults["gridColor"]);
- $("#cBorderColor")["spectrum"]("set", defaults["borderColor"]);
- getData();
- }
- }
- function getData() {
- values["interfaceForegroundColor"] = $("#cUiForegroundColor")["spectrum"]("get")["toRgbString"]();
- values["interfaceBackgroundColor"] = $("#cUiBackgroundColor")["spectrum"]("get")["toRgbString"]();
- values["gameBackgroundColor"] = $("#cGameBackground")["spectrum"]("get")["toRgbString"]();
- values["gridColor"] = $("#cGridColor")["spectrum"]("get")["toRgbString"]();
- values["borderColor"] = $("#cBorderColor")["spectrum"]("get")["toRgbString"]();
- $(".fg-interface-color")["css"]({
- "color" : values["interfaceForegroundColor"]
- });
- $(".interface-color")["css"]({
- "color" : values["interfaceForegroundColor"],
- "background-color" : values["interfaceBackgroundColor"]
- });
- $(".main-cover")["css"]({
- "color" : values["interfaceForegroundColor"],
- "background-color" : values["interfaceBackgroundColor"]
- });
- $(".gota-btn")["css"]({
- "color" : values["interfaceForegroundColor"],
- "background-color" : values["interfaceBackgroundColor"]
- });
- $(".popup-panel")["css"]({
- "color" : values["interfaceForegroundColor"],
- "background-color" : values["interfaceBackgroundColor"]
- });
- $(".main-version")["css"]({
- "color" : values["interfaceForegroundColor"]
- });
- }
- function prepare() {
- var deltaX = Date["now"]() - minX;
- minX = Date["now"]();
- var FALSE = Math["min"](deltaX / 90, 1);
- imageX = imageX + deltaX;
- item["save"]();
- item["clearRect"](0, 0, popcornVideo["width"], popcornVideo["height"]);
- item["fillStyle"] = values["gameBackgroundColor"];
- item["fillRect"](0, 0, popcornVideo["width"], popcornVideo["height"]);
- var randomHexColor = 0;
- var sumOfFontSizes = 0;
- var numberOfCountedTextNodes = 0;
- var tileLayerCode = 0;
- var options = null;
- var i;
- for (i in self["myCells"]) {
- options = self["myCells"][i];
- if (options["steps"] > 0) {
- options["animate"](FALSE);
- }
- if (options != null) {
- randomHexColor = randomHexColor + options["x"];
- sumOfFontSizes = sumOfFontSizes + options["y"];
- tileLayerCode = tileLayerCode + options["size"];
- numberOfCountedTextNodes++;
- }
- }
- if (numberOfCountedTextNodes != 0) {
- self["centerX"] = randomHexColor / numberOfCountedTextNodes;
- self["centerY"] = sumOfFontSizes / numberOfCountedTextNodes;
- self["centerSteps"] = 0;
- if (fields["cDisableAutoZoom"]) {
- self["scale_base"] = .25 * Math["max"](popcornVideo["height"] / 1080, popcornVideo["width"] / 1920);
- } else {
- self["scale_base"] = Math["pow"](Math["min"](64 / tileLayerCode, 1), .4) * Math["max"](popcornVideo["height"] / 1080, popcornVideo["width"] / 1920);
- }
- }
- if (self["centerSteps"] > 0) {
- self["centerX"] += (self["centerX_"] - self["centerX"]) * FALSE;
- self["centerY"] += (self["centerY_"] - self["centerY"]) * FALSE;
- }
- var _0x4B4D = self["scale_base"] * self["mouseZoom"];
- self["scale"] = (9 * self["scale"] + _0x4B4D) / 10;
- item["scale"](self["scale"], self["scale"]);
- self["offsetX"] = popcornVideo["width"] / 2 / self["scale"] - self["centerX"];
- self["offsetY"] = popcornVideo["height"] / 2 / self["scale"] - self["centerY"];
- if (fields["cShowGrid"]) {
- moveFile(item);
- }
- item["translate"](self["offsetX"], self["offsetY"]);
- if (fields["cShowBorder"]) {
- load_options();
- }
- if (!fields["cHideFood"]) {
- for (i in self["foodObjects"]) {
- options = self["foodObjects"][i];
- if (options["steps"] > 0) {
- options["animate"](FALSE);
- }
- options["drawFood"](item);
- }
- }
- i = self["sorted"]["length"] - 1;
- for (; i >= 0; i--) {
- options = self["sorted"][i];
- if (options["steps"] > 0 && options["playerId"] != self["playerId"]) {
- options["animate"](FALSE);
- }
- options["draw"](item);
- }
- item["restore"]();
- if (!fields["cHideMinimap"]) {
- _setEndPoint(FALSE);
- }
- if (fields["cShowCoordinates"]) {
- handleUploads();
- }
- if (self["isConnected"]() && items["css"]("display") == "none") {
- var _self = self["mouseRawX"] * scale / self["scale"] - self["offsetX"];
- var _0x4B2F = self["mouseRawY"] * scale / self["scale"] - self["offsetY"];
- self["sendPacket"](new PaintTools["sendMouse"](_self, _0x4B2F));
- if (_0x5D95) {
- self["sendPacket"](new PaintTools["sendKey"](21));
- }
- }
- if (meta["enabled"] && meta["particles"] && !fields["cDisableEffects"] && !fields["cDisableEventSkins"] && !startApp(items)) {
- settings["onTick"](item, deltaX);
- }
- self["buffHolder"]["render"](item);
- artistTrack++;
- if (imageX >= 1E3) {
- $("#playerFps")["html"](artistTrack);
- imageX = 0;
- artistTrack = 0;
- }
- window["requestAnimationFrame"](prepare);
- }
- function load_options() {
- if (self["border"]["enabled"]) {
- item["lineWidth"] = 32;
- item["strokeStyle"] = values["borderColor"];
- item["strokeRect"](self["border"]["left"], self["border"]["top"], self["border"]["width"], self["border"]["height"]);
- item["lineWidth"] = 1;
- }
- }
- function moveFile(item) {
- var i = popcornVideo["height"] / self["scale"];
- var minboxVal = popcornVideo["width"] / self["scale"];
- item["beginPath"]();
- var value = self["offsetX"] % 100;
- for (; value < minboxVal; value = value + 100) {
- item["moveTo"](value, 0);
- item["lineTo"](value, i);
- }
- value = self["offsetY"] % 100;
- for (; value < i; value = value + 100) {
- item["moveTo"](0, value);
- item["lineTo"](minboxVal, value);
- }
- item["closePath"]();
- item["strokeStyle"] = values["gridColor"];
- item["globalAlpha"] = .25;
- item["stroke"]();
- item["globalAlpha"] = 1;
- }
- function handleUploads() {
- $(".coordinates")["css"]({
- "color" : values["interfaceForegroundColor"]
- });
- $(".coordinates")["html"]("X: " + self["centerX"]["toFixed"](2) + " Y: " + self["centerY"]["toFixed"](2));
- }
- function _setEndPoint(st) {
- if (!self["border"]["enabled"]) {
- return;
- }
- memo["clearRect"](0, 0, popcornMedia["width"], popcornMedia["height"]);
- memo["font"] = "12px Calibri";
- var type = 0;
- for (; type < self["party"]["length"]; type++) {
- var t = self["party"][type];
- if (t["x_"] != command && t["y_"] != command && t["id"] != self["playerId"]) {
- _compareBoundaryPoints(memo, t["name"], t["x"], t["y"], 4, t["mmColor"], true);
- t["x"] += (t["x_"] - t["x"]) * st;
- t["y"] += (t["y_"] - t["y"]) * st;
- }
- }
- _compareBoundaryPoints(memo, self["name"], self["centerX"], self["centerY"], 6, "#fefefe", false);
- }
- function scopeReadChanged() {
- if (_0x54AD == false && p_extl["playCounter"] > 0) {
- result["enabled"] = false;
- result["lockedName"] = "";
- }
- updater();
- }
- function Self() {
- this["socket"] = null;
- this["currentServer"] = null;
- this["currentServerName"] = null;
- this["spectate"] = false;
- this["name"] = "";
- this["playerId"] = -1;
- this["bucket"] = {};
- this["sorted"] = [];
- this["foodObjects"] = {};
- this["myCells"] = {};
- this["playerRegistry"] = new NativePrimitive;
- this["buffHolder"] = new renderTilesTransform;
- this["centerX"] = 0;
- this["centerY"] = 0;
- this["centerX_"] = 0;
- this["centerY_"] = 0;
- this["centerSteps"] = 0;
- this["scale"] = 1;
- this["scale_"] = 1;
- this["scale_base"] = 1;
- this["mouseZoom"] = 1;
- this["offsetX"] = 0;
- this["offsetY"] = 0;
- this["mouseRawX"] = 0;
- this["mouseRawY"] = 0;
- this["mouseX"] = 0;
- this["mouseY"] = 0;
- this["rainbow"] = false;
- this["party"] = [];
- this["partyIds"] = {};
- this["border"] = {};
- this["serverMaxCells"] = 16;
- this["score"] = 0;
- this["clearStats"]();
- setInterval(this["sendPing"]["bind"](this), 3E4);
- }
- function users(index) {
- this["id"] = index;
- this["type"] = 0;
- this["nameCache"] = null;
- this["skin"] = null;
- this["playerId"] = 0;
- this["color"] = null;
- this["x"] = 0;
- this["y"] = 0;
- this["x_"] = 0;
- this["y_"] = 0;
- this["size"] = 0;
- this["size_"] = 0;
- this["steps"] = 0;
- this["massLastAmount"] = -1;
- this["cache"] = null;
- }
- function NativePrimitive() {
- this["bucket"] = {};
- this["defaultData"];
- this["init"] = function() {
- this["defaultData"] = new Type(0);
- this["defaultData"]["name"] = "";
- this["defaultData"]["cellColor"] = "#aaa";
- };
- this["add"] = function(options) {
- this["bucket"][options["id"]] = options;
- };
- this["remove"] = function(ballNumber) {
- delete this["bucket"][ballNumber];
- };
- this["clear"] = function() {
- this["bucket"] = {};
- };
- this["getPlayer"] = function(ballNumber) {
- return this["bucket"][ballNumber];
- };
- this["getPlayerById"] = function(ballNumber) {
- var ball = this["bucket"][ballNumber];
- return ball != null ? ball : this["defaultData"];
- };
- this["init"]();
- }
- function Type(type) {
- this["id"] = type;
- this["name"];
- this["skin"];
- this["skinCache"];
- this["cellColor"];
- this["nameColor"] = "#fff";
- this["flags"] = 0;
- this["effect"] = 0;
- this["lowerName"] = false;
- this["nameCache"] = null;
- this["cacheUpdate"] = false;
- this["parseEffect"] = function(canCreateDiscussions) {
- if (canCreateDiscussions >= 64) {
- canCreateDiscussions = canCreateDiscussions - 64;
- this["lowerName"] = true;
- } else {
- this["lowerName"] = false;
- }
- this["effect"] = canCreateDiscussions;
- };
- this["getNameCache"] = function() {
- if (this["nameCache"] == null || this["cacheUpdate"] == true) {
- this["createNameCache"]();
- }
- return this["nameCache"]["canvas"];
- };
- this["createNameCache"] = function() {
- var popcornVideo = this["nameCache"] == null || this["nameCache"]["canvas"] == null ? document["createElement"]("canvas") : this["nameCache"]["canvas"];
- this["nameCache"] = popcornVideo["getContext"]("2d");
- var val = 54;
- var size_human = "bold 54pt Verdana";
- this["nameCache"]["font"] = size_human;
- popcornVideo["width"] = this["nameCache"]["measureText"](this["name"])["width"] + 4;
- popcornVideo["height"] = Math["floor"](val * 1.35);
- this["nameCache"]["font"] = size_human;
- this["nameCache"]["fillStyle"] = this["nameColor"];
- this["nameCache"]["fillText"](this["name"], 2, val);
- if (fields["cTextOutlines"] == true) {
- this["nameCache"]["lineWidth"] = 2;
- this["nameCache"]["strokeStyle"] = "#000";
- this["nameCache"]["strokeText"](this["name"], 2, val);
- }
- this["cacheUpdate"] = false;
- };
- this["setSkin"] = function(params) {
- if (params["length"] == 0) {
- return null;
- }
- var options = params["indexOf"]("[");
- if (options != -1) {
- var req = params["indexOf"]("]", options);
- if (req != -1) {
- params = params["substring"](options + 1, req);
- }
- }
- var osFamilies = params["toLowerCase"]();
- if (osFamilies["length"] != 0 && osFamilies != this["skin"]) {
- this["skin"] = osFamilies;
- this["skinCache"] = null;
- }
- };
- this["getSkin"] = function() {
- if (this["skinCache"] != null) {
- return this["skinCache"];
- }
- if (this["skin"] != null) {
- if (array[this["skin"]] != null) {
- if (array[this["skin"]] == 1) {
- array[this["skin"]] = new Image;
- array[this["skin"]]["src"] = "https://gamedata.gota.io/skins/" + this["skin"] + ".png";
- array[this["skin"]]["addEventListener"]("error", function() {
- delete array[name];
- });
- this["skinCache"] = array[this["skin"]];
- } else {
- this["skinCache"] = array[this["skin"]];
- return this["skinCache"];
- }
- } else {
- this["skin"] = null;
- }
- }
- return null;
- };
- }
- function Game() {
- }
- function cb(b, a, n) {
- var evdata = 0;
- for (; evdata < n["length"]; evdata++) {
- a["setUint8"](b, n["charCodeAt"](evdata));
- b++;
- }
- a["setUint8"](b, 0);
- }
- function log(id, self, selector) {
- var verb = 0;
- for (; verb < selector["length"]; verb++) {
- self["setUint16"](id, selector["charCodeAt"](verb), true);
- id = id + 2;
- }
- self["setUint16"](id, 0, true);
- }
- function require(options) {
- var tmp = "";
- for (; true;) {
- var start = options["getUint8"](options["offset"]);
- options["offset"]++;
- if (start == 0) {
- break;
- }
- tmp = tmp + String["fromCharCode"](start);
- }
- return tmp;
- }
- function compare(options) {
- var result = "";
- for (; true;) {
- var chunkCursor = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- if (chunkCursor == 0) {
- break;
- }
- result = result + String["fromCharCode"](chunkCursor);
- }
- return result;
- }
- function clickWithWebdriver(selector) {
- for (; true;) {
- var _0x4A99 = selector["getUint16"](selector["offset"], true);
- selector["offset"] += 2;
- if (_0x4A99 == 0) {
- break;
- }
- }
- }
- function buildJS(trace, done) {
- console["error"](trace["message"], trace["code"]);
- if (done) {
- switch(trace["code"]) {
- case "auth/user-disabled":
- alert("This account has been permanently suspended by an administrator.");
- break;
- case "auth/popup-closed-by-user":
- break;
- default:
- alert(trace["message"] + " (" + trace["code"] + ")");
- break;
- }
- }
- }
- function n(n) {
- return n["charAt"](0)["toUpperCase"]() + n["slice"](1);
- }
- function trim(text) {
- switch(text) {
- case "classic":
- return "Classic";
- break;
- case "instant":
- return "Instant Merge";
- break;
- case "megasplit":
- return "Mega Split";
- break;
- default:
- return text;
- break;
- }
- }
- function mouseout(target) {
- var _results = false;
- Object["keys"](target)["map"]((i) => {
- if (target[i]["wins"] > 0 || target[i]["losses"] > 0) {
- _results = true;
- }
- });
- return _results;
- }
- function text(elem, options) {
- var session_key = "";
- var total_rows = "";
- var oldPriority = "white";
- if (options["flags"]["STAFF"]) {
- total_rows = "Gota.io Staff";
- session_key = "build";
- oldPriority = "royalblue";
- } else {
- if (options["flags"]["VERIFIED"]) {
- total_rows = "Verified Player";
- session_key = "check_circle";
- } else {
- return;
- }
- }
- var result = document["createElement"]("i");
- result["className"] = "material-icons";
- result["id"] = "user-badge";
- result["innerText"] = session_key;
- result["style"]["color"] = oldPriority;
- $(result)["attr"]("data-balloon", total_rows);
- $(result)["attr"]("data-balloon-pos", "up");
- $(elem)["append"](result);
- }
- function Popcorn(options, entity) {
- var params = document["createElement"]("i");
- params["className"] = "material-icons";
- params["innerText"] = options;
- params["setAttribute"]("data-balloon", entity);
- params["setAttribute"]("data-balloon-pos", "up");
- return params;
- }
- function fn(result, options, state, searching) {
- var node = document["createElement"]("li");
- node["className"] = "user-embed";
- var params = document["createElement"]("img");
- params["src"] = result["avatar"];
- params["alt"] = result["username"];
- node["appendChild"](params);
- var a = document["createElement"]("div");
- a["className"] = "info";
- var b = document["createElement"]("div");
- b["className"] = "username";
- b["innerText"] = result["username"];
- a["appendChild"](b);
- text(b, result);
- var item = document["createElement"]("div");
- var hasExtend = false;
- var title = null;
- if (state) {
- title = n(result["presence"]["server"]);
- if (result["presence"]["timestamp"] + 1E3 * 60 < (new Date)["getTime"]() || result["presence"]["id"] === undefined) {
- item["className"] = "status offline";
- item["innerText"] = "Not playing on any server";
- } else {
- hasExtend = true;
- item["className"] = "status " + (result["presence"]["status"] === "ONLINE" ? "online" : "spectate");
- item["innerText"] = (result["presence"]["status"] === "ONLINE" ? "Playing " : "Spectating ") + result["presence"]["gamemode"] + " on " + title + " (ID " + result["presence"]["id"] + ")";
- }
- } else {
- item["className"] = "status pending";
- item["innerText"] = "Pending Friend Request";
- }
- a["appendChild"](item);
- var event = document["createElement"]("div");
- event["className"] = "actions";
- var popcornVideo = Popcorn("face", "View Profile");
- popcornVideo["addEventListener"]("click", function(canCreateDiscussions) {
- create(result, $("#main-social"));
- });
- event["append"](popcornVideo);
- if (state && hasExtend) {
- var popcornVideo = Popcorn("input", "Join Server");
- popcornVideo["addEventListener"]("click", function(canCreateDiscussions) {
- remove(title);
- self["play"]();
- self["selfMsg"](result["username"] + "'s ID is " + result["presence"]["id"]);
- find($("#main-social"));
- });
- event["appendChild"](popcornVideo);
- }
- if (!state) {
- var popcornVideo = Popcorn("done", "Add as Friend");
- popcornVideo["isHandlingRequest"] = false;
- popcornVideo["addEventListener"]("click", function(canCreateDiscussions) {
- if (popcornVideo["isHandlingRequest"]) {
- return;
- }
- popcornVideo["isHandlingRequest"] = true;
- firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
- fetch(HOST + "/api/v1/social/friends", {
- method : "POST",
- headers : {
- "Content-Type" : "application/json"
- },
- body : JSON["stringify"]({
- token : textClass,
- target : result["uid"],
- action : 2
- })
- })["then"]((options) => {
- return options["json"]();
- })["then"]((result) => {
- if (result["code"] !== 200) {
- alert(result["message"]);
- }
- popcornVideo["isHandlingRequest"] = false;
- })["catch"]((bbls) => {
- alert(bbls);
- popcornVideo["isHandlingRequest"] = false;
- });
- })["catch"]((name) => {
- buildJS(name, true);
- popcornVideo["isHandlingRequest"] = false;
- });
- });
- event["appendChild"](popcornVideo);
- }
- var this_stream = Popcorn("block", "Remove Friend");
- this_stream["isHandlingRequest"] = false;
- this_stream["addEventListener"]("click", function(canCreateDiscussions) {
- if (this_stream["isHandlingRequest"] || !confirm("Are you sure you want to remove " + result["username"] + " as your friend?")) {
- return;
- }
- this_stream["isHandlingRequest"] = true;
- firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
- fetch(HOST + "/api/v1/social/friends", {
- method : "POST",
- headers : {
- "Content-Type" : "application/json"
- },
- body : JSON["stringify"]({
- token : textClass,
- target : result["uid"],
- action : 4
- })
- })["then"]((options) => {
- return options["json"]();
- })["then"]((result) => {
- alert(result["message"]);
- if (result["code"] === 200) {
- firebase["database"]()["ref"](options["callbacks"][result["uid"]])["off"]();
- options["elements"][result["uid"]]["remove"]();
- delete options["callbacks"][result["uid"]];
- delete options["elements"][result["uid"]];
- }
- this_stream["isHandlingRequest"] = false;
- })["catch"]((bbls) => {
- alert(bbls);
- this_stream["isHandlingRequest"] = false;
- });
- })["catch"]((name) => {
- buildJS(name, true);
- this_stream["isHandlingRequest"] = false;
- });
- });
- event["appendChild"](this_stream);
- a["appendChild"](event);
- node["appendChild"](a);
- if (searching) {
- return options["appendChild"](node);
- } else {
- return node;
- }
- }
- function create(result, value) {
- wrap(value);
- append($("#popup-profile"));
- $("#popup-profile-text")["empty"]();
- $("#profile-username")["text"](result["username"]);
- $("#profile-avatar")["attr"]("src", result["avatar"]);
- $("#profile-avatar")["attr"]("alt", result["username"]);
- $("#profile-level")["text"]("Level " + result["levelData"]["level"]);
- $("#profile-username")["off"]("click");
- if (result["uid"] == expected["uid"]) {
- $("#profile-username")["on"]("click", function() {
- $("#popup-profile")["hide"]();
- wrap($("#popup-account-username"));
- });
- $("#profile-username")["css"]("cursor", "pointer");
- } else {
- $("#profile-username")["css"]("cursor", "default");
- }
- if (result["flags"]["STAFF"]) {
- $("#profile-avatar")["addClass"]("spin");
- } else {
- $("#profile-avatar")["removeClass"]("spin");
- }
- text($("#profile-username"), result);
- var self = document["createElement"]("div");
- self["className"] = "profile-ranked-container";
- var item = document["createElement"]("span");
- item["innerText"] = "Ranked";
- item["className"] = "profle-inline-title";
- $("#popup-profile-text")["append"](item);
- Object["keys"](result["ranked"])["map"]((selector) => {
- gamemodeData = result["ranked"][selector];
- var item = document["createElement"]("div");
- var settings = document["createElement"]("span");
- settings["innerText"] = trim(selector);
- item["appendChild"](settings);
- var this_stream = document["createElement"]("span");
- this_stream["innerText"] = gamemodeData["wins"] + "W/" + gamemodeData["losses"] + "L";
- item["appendChild"](this_stream);
- var value = document["createElement"]("span");
- value["innerText"] = gamemodeData["mmr"] + "MMR";
- item["appendChild"](value);
- self["appendChild"](item);
- });
- if (!mouseout(result["ranked"])) {
- var item = document["createElement"]("span");
- item["className"] = "ranked-info-unavailable";
- item["innerText"] = "User has not played ranked before";
- $("#popup-profile-text")["append"](item);
- }
- $("#popup-profile-text")["append"](self);
- }
- function uploadFiles(item) {
- if (_0x5129) {
- return;
- }
- var self = $("#social-friends .user-list")[0];
- var params = $("#social-friends .user-list")[1];
- $("#social-uid")["text"](item["uid"]);
- firebase["database"]()["ref"]("/friendships/" + item["uid"])["on"]("value", function(options) {
- if (options["val"]() === null) {
- var obj = document["createElement"]("div");
- var params = document["createElement"]("span");
- obj["className"] = "title-text center";
- params["innerText"] = "You have no friends 😥";
- obj["appendChild"](params);
- self["appendChild"](obj);
- return;
- }
- var obj = options["val"]();
- var callback = false;
- Object["keys"](obj)["map"]((i) => {
- var name = obj[i];
- if (!name && !callback) {
- callback = true;
- firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
- fetch(HOST + "/api/v1/social/friends/pending", {
- method : "POST",
- headers : {
- "Content-Type" : "application/json"
- },
- body : JSON["stringify"]({
- token : textClass
- })
- })["then"]((options) => {
- return options["json"]();
- })["then"]((result) => {
- if (result["code"] === 200) {
- result["profiles"]["forEach"]((a) => {
- if (!options["pendingFriends"]["includes"](a)) {
- options["pendingFriends"]["push"](a["uid"]);
- }
- if (options["elements"][a["uid"]]) {
- var result = fn(a, options["elements"][a["uid"]], false, false);
- params["replaceChild"](result, options["elements"][a["uid"]]);
- options["elements"][i] = result;
- return;
- }
- options["elements"][a["uid"]] = fn(a, params, false, true);
- });
- }
- });
- })["catch"]((name) => {
- return buildJS(name, false);
- });
- return;
- }
- if (!options["callbacks"][i]) {
- var newname = "/users/" + i;
- options["callbacks"][i] = newname;
- firebase["database"]()["ref"](newname)["on"]("value", function(MapData) {
- if (MapData["val"]() === null) {
- return;
- }
- var result = MapData["val"]();
- options["timestamps"][result["uid"]] = result["presence"]["timestamp"];
- if (options["pendingFriends"]["includes"](i)) {
- options["pendingFriends"]["slice"](options["pendingFriends"]["indexOf"](i), 1);
- options["elements"][i]["remove"]();
- var next = fn(result, options["elements"][i], true, false);
- self["appendChild"](next);
- options["elements"][i] = next;
- return;
- }
- if (options["elements"][i]) {
- next = fn(result, options["elements"][i], true, false);
- self["replaceChild"](next, options["elements"][i]);
- options["elements"][i] = next;
- return;
- }
- options["elements"][i] = fn(result, self, true, true);
- });
- }
- });
- });
- setInterval(function() {
- var j;
- for (j in options["timestamps"]) {
- if (!options["timestamps"]["hasOwnProperty"](j)) {
- return;
- }
- var _shapeB = options["timestamps"][j];
- if (_shapeB + 1E3 * 60 < (new Date)["getTime"]() || _shapeB === undefined) {
- var colorRamps = options["elements"][j]["children"][1]["children"][1];
- colorRamps["innerText"] = "Not playing on any server";
- colorRamps["className"] = "status offline";
- var result = options["elements"][j]["children"][1]["children"][2]["children"][1];
- if (result["dataset"]["balloon"] === "Join Server") {
- result["remove"]();
- }
- }
- }
- }, 1E3 * 60);
- _0x5129 = true;
- }
- function send() {
- function upld(isMouseandNotTouch, argImage) {
- if (isMouseandNotTouch) {
- $(argImage)["prop"]("disabled", false);
- $(argImage)["text"]("Set");
- return;
- }
- $(argImage)["prop"]("disabled", true);
- $(argImage)["text"]("...");
- }
- if (meta["enabled"] && !fields["cDisableEventSkins"]) {
- $("body")["toggleClass"]("event-" + meta["key"]);
- }
- $(".server-tab")["on"]("click", function() {
- var gotExpectedDetails = $(this)["attr"]("region");
- ok(gotExpectedDetails);
- });
- $("#btn-play")["on"]("click", function() {
- if (Object["keys"](self["myCells"])["length"] != 0 && this["currentServerName"] == children["name"]) {
- find(items);
- return;
- }
- self["spectate"] = false;
- if (p_extl["incrementPlay"]() && typeof adplayer != "undefined") {
- adplayer["startPreRoll"]();
- find(items);
- refreshFilteredDataSource();
- } else {
- self["play"]();
- }
- });
- $("#btn-servers")["on"]("click", function() {
- f("main-servers");
- });
- $("#btn-options")["on"]("click", function() {
- f("main-options");
- });
- $("#btn-themes")["on"]("click", function() {
- f("main-themes");
- });
- $("#btn-cellpanel")["on"]("click", function() {
- f("main-subpanel");
- });
- $("#btn-forums")["on"]("click", function() {
- window["open"]("https://forums.gota.io", "_blank");
- });
- $("#btn-trello")["on"]("click", function() {
- window["open"]("https://trello.com/b/G1yNkEDH/gotaio", "_blank");
- });
- $("#name-box")["keypress"](function(options) {
- if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
- self["play"]();
- }
- });
- $("#btn-spec")["on"]("click", function() {
- if (self["spectate"] && this["currentServerName"] == children["name"]) {
- find(items);
- return;
- }
- self["spectate"] = true;
- if (p_extl["incrementPlay"]() && typeof adplayer != "undefined") {
- adplayer["startPreRoll"]();
- find(items);
- refreshFilteredDataSource();
- } else {
- self["spec"]();
- }
- });
- $("#chat-input")["keyup"](function(options) {
- var popcornVideo = $(this)["val"]();
- var result = popcornVideo["split"](" ");
- if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
- fetch($(this)["val"]());
- }
- if (popcornVideo["length"] == 0 || popcornVideo["endsWith"](" ") || options["keyCode"] == 13) {
- $("#autocomplete-panel")["html"]("");
- $("#autocomplete-panel")["hide"]();
- } else {
- if (popcornVideo["startsWith"]("/")) {
- if (result["length"] > 1) {
- return;
- }
- $("#autocomplete-panel")["html"]("<table><thead><tr><th>Command</th><th>Aliases</th><th>Description</th></tr></thead><tbody></tbody></table>");
- var i = -1;
- Object["values"](target)["map"]((result) => {
- if ((i = result["triggers"]["findIndex"]((options) => {
- return options["toLowerCase"]()["startsWith"](result[0]["substring"](1)["toLowerCase"]());
- })) > -1) {
- $("#autocomplete-panel tbody")["append"]("<tr><td>" + result["triggers"][i] + "</td><td>" + result["triggers"] + "</td><td>" + result["description"] + "</td></tr>");
- }
- });
- if ($("#autocomplete-panel tbody")["children"]()["length"] == 0) {
- $("#autocomplete-panel")["hide"]();
- } else {
- $("#autocomplete-panel")["show"]();
- }
- } else {
- if (result[result["length"] - 1]["startsWith"](":")) {
- $("#autocomplete-panel")["html"]("");
- var osFamilies = Object["keys"](bottoms)["filter"]((options) => {
- return options["toLowerCase"]()["includes"](result[result["length"] - 1]["substring"](1)["toLowerCase"]());
- });
- var location_feature_ids = Object["keys"](gifEmoteList)["filter"]((options) => {
- return options["toLowerCase"]()["includes"](result[result["length"] - 1]["substring"](1)["toLowerCase"]());
- });
- if (osFamilies["length"] === 0 && location_feature_ids["length"] === 0) {
- $("#autocomplete-panel")["html"]("");
- $("#autocomplete-panel")["hide"]();
- return;
- } else {
- $("#autocomplete-panel")["show"]();
- }
- if (osFamilies["length"] > 0) {
- $("#autocomplete-panel")["append"]("<h3>Emotes</h3>");
- osFamilies["forEach"]((rel) => {
- $("#autocomplete-panel")["append"]("<img name='" + rel + "' title='" + rel + "' src='https://gamedata.gota.io/emotes/" + rel + ".png' />");
- });
- }
- if (location_feature_ids["length"] > 0) {
- $("#autocomplete-panel")["append"]("<h3>Gifs</h3>");
- location_feature_ids["forEach"]((rel) => {
- $("#autocomplete-panel")["append"]("<img name='" + rel + "' title='" + rel + "' src='https://gamedata.gota.io/emotes/gifs/" + rel + ".gif' />");
- });
- }
- }
- }
- }
- });
- $("#autocomplete-panel")["on"]("click", function(result) {
- var workers = forEach()["split"](" ");
- if (result["target"]["nodeName"] === "TD") {
- $get("/" + result["target"]["parentElement"]["children"][0]["innerHTML"] + " ");
- $("#autocomplete-panel")["html"]("");
- $("#autocomplete-panel")["hide"]();
- $("#chat-input")["focus"]();
- } else {
- if (result["target"]["nodeName"] === "IMG") {
- $get(forEach()["substring"](0, forEach()["length"] - workers[workers["length"] - 1]["length"]) + result["target"]["attributes"]["name"]["nodeValue"] + " ");
- $("#autocomplete-panel")["html"]("");
- $("#autocomplete-panel")["hide"]();
- $("#chat-input")["focus"]();
- }
- }
- });
- $("#chat-emote-btn")["css"]("background-image", "url(https://gamedata.gota.io/emotes/" + _tabInfo[Math["floor"](Math["random"]() * _tabInfo["length"])] + ".png)");
- $("#chat-emote-btn")["on"]("click", function() {
- $("#emote-panel")["toggle"]();
- });
- $("#emote-panel ul li img")["on"]("click", function(result) {
- sendResponses(result["target"]["name"] + " ");
- $("#chat-input")["focus"]();
- });
- (function() {
- function onload(node) {
- pos = node["clientX"];
- arg = node["clientY"];
- start = parseInt(document["defaultView"]["getComputedStyle"](result)["width"], 10);
- argN2 = parseInt(document["defaultView"]["getComputedStyle"](result)["height"], 10);
- document["documentElement"]["addEventListener"]("mousemove", noop, false);
- document["documentElement"]["addEventListener"]("mouseup", success, false);
- }
- function noop(options) {
- result["style"]["width"] = start + options["clientX"] - pos + "px";
- result["style"]["height"] = argN2 - (options["clientY"] - arg) + "px";
- }
- function success(retu_data) {
- document["documentElement"]["removeEventListener"]("mousemove", noop, false);
- document["documentElement"]["removeEventListener"]("mouseup", success, false);
- }
- var result = document["getElementById"]("chat-panel");
- document["getElementById"]("chat-resize")["addEventListener"]("mousedown", onload, false);
- var pos;
- var arg;
- var start;
- var argN2;
- })();
- $(".checkbox-options")["on"]("change", function(canCreateDiscussions) {
- startCircleAnim($(this));
- });
- $(".options-container select")["on"]("change", function(canCreateDiscussions) {
- bindEvents($(this));
- });
- $("#btn-login")["on"]("click", function() {
- self["login"]();
- });
- $("#id-box")["keypress"](function(options) {
- if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
- if ($("#pw-box")["val"]()["length"] < 1) {
- $("#pw-box")["focus"]();
- } else {
- self["login"]();
- }
- }
- });
- $("#pw-box")["keypress"](function(options) {
- if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
- if ($("#id-box")["val"]() < 1) {
- $("#id-box")["focus"]();
- } else {
- self["login"]();
- }
- }
- });
- $("#btn-cancel")["on"]("click", function() {
- find($("#popup-login"));
- append(items);
- });
- $("#btn-changelog")["on"]("click", function() {
- find($("#popup-changelog"));
- append(items);
- window["open"](processEvaluatorsCallback, "_blank");
- });
- $("#btn-close-changelog")["on"]("click", function() {
- find($("#popup-changelog"));
- append(items);
- });
- $("#btn-accept")["on"]("click", function() {
- self["sendPacket"](new PaintTools["sendInviteResponse"](true));
- find($("#popup-party"));
- });
- $("#btn-decline")["on"]("click", function() {
- self["sendPacket"](new PaintTools["sendInviteResponse"](false));
- find($("#popup-party"));
- });
- $("#popup-party-code-content button")["on"]("click", function() {
- $("#popup-party-code-content input")["select"]();
- document["execCommand"]("Copy");
- $("#popup-party-code")["hide"]();
- });
- $("#menu-invite")["on"]("click", function() {
- var _0x4A99 = elem["data"]("selected");
- self["sendPacket"](new PaintTools["sendPartyAction"](0, _0x4A99));
- });
- $("#menu-whisper")["on"]("click", function() {
- var rel = elem["data"]("selected");
- var _0x4AB7 = $("#chat-input")["val"]();
- $("#chat-input")["val"]("/t " + rel + " " + _0x4AB7);
- });
- $("#menu-pu_pr")["on"]("click", function() {
- if (self["partyCode"] == undefined) {
- self["sendPacket"](new PaintTools["sendPartyAction"](4, 0));
- $("#menu-pu_pr span")["text"]("Private");
- } else {
- self["sendPacket"](new PaintTools["sendPartyAction"](4, 1));
- $("#menu-pu_pr span")["text"]("Public");
- }
- });
- $("#menu-promote")["on"]("click", function() {
- var _0x4A99 = elem["data"]("party") + 1;
- if (_0x4A99 >= 0) {
- self["sendPacket"](new PaintTools["sendPartyAction"](2, _0x4A99));
- }
- });
- $("#menu-kick")["on"]("click", function() {
- var _0x4A99 = elem["data"]("party") + 1;
- if (_0x4A99 >= 0) {
- self["sendPacket"](new PaintTools["sendPartyAction"](1, _0x4A99));
- }
- });
- $("#menu-spectate")["on"]("click", function() {
- var _self = elem["data"]("selected");
- if (_self >= 0) {
- self["sendPacket"](new PaintTools["sendSpectate"](_self));
- }
- });
- $("#menu-block")["on"]("click", function() {
- var level = parseInt(elem["data"]("selected"));
- var item = getByProp(level);
- self["selfMsg"](item);
- });
- $(document)["on"]("click", function(result) {
- elem["hide"]();
- if (result["target"]["id"] !== "chat-emote-btn") {
- $("#emote-panel")["hide"]();
- }
- if ($("#popup-party-code")["css"]("display") !== "none" && result["target"]["id"] !== "popup-party-code") {
- $("#popup-party-code")["hide"]();
- }
- });
- firebase["auth"]()["onAuthStateChanged"](function(unit) {
- if (unit) {
- nunjucksInjector();
- var popcornVideo = firebase["database"]()["ref"]("users/" + unit["uid"]);
- var _0x4AF3 = false;
- popcornVideo["on"]("value", function(MapData) {
- var options = MapData["val"]();
- if (!options) {
- return;
- }
- if (!_0x4AF3) {
- $("#account-loader")["hide"]();
- $("#authed")["show"]();
- $("#authed")["attr"]("style", "display: flex;");
- _0x4AF3 = true;
- }
- expected = options;
- $("#account-avatar")["attr"]("src", options["avatar"]);
- $("#account-username")["text"](options["username"]);
- text($("#account-username"), options);
- $("#account-level")["text"]("Level " + options["levelData"]["level"] + " | " + options["levelData"]["xp_current"] + "/" + options["levelData"]["xp_needed"] + "XP" + " | " + options["currency"] + " bits");
- $(".xp-meter > span")["each"](function() {
- var length = options["levelData"]["xp_current"] / options["levelData"]["xp_needed"] * 100;
- $(this)["animate"]({
- width : length + "%"
- }, 1200);
- });
- if (result["enabled"]) {
- close();
- firebase["firestore"]()["collection"]("accounts")["doc"](expected["uid"])["onSnapshot"]((options) => {
- if (options["data"]()["locked"]) {
- $("#spLockedName")["html"](options["data"]()["name"]);
- if (options["data"]()["lastChange"] !== undefined) {
- $("#btn-chg-ln")["attr"]("title", "Last Changed: " + (new Date(options["data"]()["lastChange"]))["toLocaleString"]());
- }
- if (options["data"]()["expiry"] !== null) {
- $("#spExpiry")["html"]((new Date(options["data"]()["expiry"]["seconds"] * 1E3))["toLocaleString"]());
- } else {
- $("#spExpiry")["html"]("Never");
- }
- } else {
- result["enabled"] = false;
- updater();
- close();
- if ($("#main-subpanel")["css"]("display") !== "none") {
- f("main-servers");
- }
- }
- }, (canCreateDiscussions) => {
- });
- }
- if (_0x5129) {
- uploadFiles(expected);
- }
- });
- } else {
- upld();
- close(false);
- }
- });
- firebase["database"]()["ref"]("/game")["on"]("value", function(options) {
- var params = options["val"]();
- if (params["version"] !== version) {
- self["selfMsg"]("Woah! Version " + params["version"] + " is now available. Press Ctrl+R to update!");
- }
- if (signature != params["motd"] && params["motd"] !== "") {
- signature = params["motd"];
- self["selfMsg"]("MOTD: " + params["motd"]);
- }
- });
- $("#account-login")["on"]("click", function() {
- firebase["auth"]()["signInWithPopup"](numKeysDeleted)["then"](function(canCreateDiscussions) {
- })["catch"]((name) => {
- return buildJS(name, true);
- });
- });
- $("#account-logout")["on"]("click", function() {
- firebase["auth"]()["signOut"]()["then"](function() {
- $("#authed")["hide"](500);
- $("#guest")["show"]();
- })["catch"]((name) => {
- return buildJS(name, true);
- });
- });
- $("#account-shop")["on"]("click", function() {
- window["open"]("https://trello.com/c/Hdnxuxuc/2-account-system", "_blank");
- });
- $("#account-social")["on"]("click", function() {
- if (!expected) {
- return;
- }
- uploadFiles(expected);
- append($("#main-social"));
- find($(items));
- });
- $("#social-back-button")["on"]("click", function() {
- find($("#main-social"));
- append($(items));
- });
- $("#account-profile")["on"]("click", function() {
- create(expected, items);
- });
- $("#profile-close-btn")["on"]("click", function() {
- wrap(items);
- find($("#popup-profile"));
- });
- $("#account-set-username-btn")["on"]("click", function() {
- if (!expected) {
- return;
- }
- upld(false, this);
- var selector = $("#account-username-input")["val"]();
- if (!selector || selector == "" || selector["trim"]() == "") {
- alert("Please provide a username!");
- upld(true, this);
- return;
- }
- firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
- fetch(HOST + "/api/v1/social/username", {
- method : "POST",
- headers : {
- "Content-Type" : "application/json"
- },
- body : JSON["stringify"]({
- token : textClass,
- username : selector
- })
- })["then"]((options) => {
- return options["json"]();
- })["then"]((result) => {
- upld(true, this);
- if (result["code"] == 200) {
- wrap(items);
- $("#popup-account-username")["hide"]();
- return;
- }
- alert(result["message"]);
- })["catch"]((a) => {
- console["error"](a);
- alert(a);
- upld(true, this);
- });
- })["catch"]((name) => {
- upld(true, this);
- buildJS(name, true);
- });
- });
- $("#username-back-button")["on"]("click", function() {
- wrap($("#popup-account-username"));
- wrap(items);
- });
- $("#btn-add-friend")["on"]("click", function(options) {
- options["preventDefault"]();
- if (!expected) {
- return;
- }
- var selector = prompt("Enter friend's UID (found above add friend button)");
- if (!selector) {
- return;
- }
- var hash = selector["replace"](/s/g, "");
- if (typeof selector !== "string" || hash["length"] === 0) {
- return alert("Please enter a valid UID");
- }
- firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
- fetch(HOST + "/api/v1/social/friends", {
- method : "POST",
- headers : {
- "Content-Type" : "application/json"
- },
- body : JSON["stringify"]({
- token : textClass,
- target : hash,
- action : 1
- })
- })["then"]((options) => {
- return options["json"]();
- })["then"]((result) => {
- alert(result["message"]);
- });
- })["catch"]((name) => {
- return buildJS(name, true);
- });
- });
- document["getElementById"]("party-canvas")["oncontextmenu"] = loadStencil;
- $(document)["keyup"](function(options) {
- if (options["keyCode"] == 13) {
- var locationMap = $("#chat-input");
- if (document["activeElement"]["tagName"] != "INPUT") {
- locationMap["focus"]();
- } else {
- if (locationMap["is"](":focus")) {
- locationMap["blur"]();
- }
- }
- }
- });
- $(window)["bind"]("beforeunload", function() {
- return "Are you sure you want to leave Gota.io?";
- });
- makeTimeoutHandler();
- $(".keybinds-btn")["on"]("click", function() {
- $(".keybinds-btn")["removeClass"]("keybinds-btn-selected");
- $(this)["addClass"]("keybinds-btn-selected");
- _0x5291 = true;
- });
- $("#scrimmage-mode-select")["on"]("change", function() {
- $("#scrimmage-mode-info")["children"]()["css"]("display", "none");
- $("#scrimmage-info-" + $(this)["val"]())["css"]("display", "block");
- });
- $("#btn-queue")["on"]("click", function() {
- var n = parseInt($("#scrimmage-mode-select")["val"]());
- var _self = isNaN(n) ? 0 : Math["min"](Math["max"](n, 0), 100);
- self["sendPacket"](new PaintTools["sendQueue"](_self));
- $(this)["blur"]();
- });
- $("#btn-leave-match")["on"]("click", function() {
- self["sendPacket"](new PaintTools["sendLeaveMatch"]);
- });
- $("#btn-custom-create")["on"]("click", function() {
- self["sendPacket"](new PaintTools["sendCustomGame"](0));
- $(this)["blur"]();
- });
- $("#btn-custom-return")["on"]("click", function() {
- self["sendPacket"](new PaintTools["sendCustomGame"](1));
- });
- $("#btn-custom-start")["on"]("click", function() {
- self["sendPacket"](new PaintTools["sendCustomGame"](2));
- });
- $("#scrimmage-map")["on"]("change", function(canCreateDiscussions) {
- var cookie = $(this)["find"]("option:selected")["val"]();
- var key = $(this)["attr"]("data");
- if (cookie != key) {
- $("#scrimmage-map option[value='" + key + "']")["prop"]("selected", true);
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["MAP"], cookie));
- }
- });
- $("#scrimmage-mapmode")["on"]("change", function(canCreateDiscussions) {
- var cookie = $(this)["find"]("option:selected")["val"]();
- var key = $(this)["attr"]("data");
- if (cookie != key) {
- $("#scrimmage-mapmode option[value='" + key + "']")["prop"]("selected", true);
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["MODE"], cookie));
- }
- });
- $("#scrimmage-mapsize")["on"]("change", function(canCreateDiscussions) {
- var cookie = $(this)["find"]("option:selected")["val"]();
- var key = $(this)["attr"]("data");
- if (cookie != key) {
- $("#scrimmage-mapsize option[value='" + key + "']")["prop"]("selected", true);
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["SIZE"], cookie));
- }
- });
- $("#scrimmage-startmass")["on"]("change", function(canCreateDiscussions) {
- var n = $(this)["val"]();
- var elem = $(this)["attr"]("data");
- if (isNaN(n)) {
- $(this)["val"](elem);
- return;
- }
- n = Math["max"](1, Math["min"](parseInt(n), 32E3));
- if (n != elem) {
- $(this)["val"](elem);
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["STARTMASS"], n));
- }
- });
- $("#scrimmage-lockteams")["on"]("change", function(canCreateDiscussions) {
- var _0x4AB7 = $(this)["prop"]("checked");
- $(this)["prop"]("checked", !_0x4AB7);
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["LOCK"], _0x4AB7 == true ? 1 : 0));
- });
- }
- function render(component) {
- var locationMap = $(".keybinds-btn-selected");
- _0x5291 = false;
- if (locationMap["size"]() == 0) {
- return;
- }
- var validate = locationMap["first"]();
- locationMap["removeClass"]("keybinds-btn-selected");
- if (component != 27) {
- params[validate["attr"]("id")] = component;
- } else {
- params[validate["attr"]("id")] = -1;
- }
- assert(validate);
- }
- function assert(options) {
- var key = params[options["attr"]("id")];
- options["html"](prefix(key));
- }
- function prefix(num) {
- return num > 0 ? tablx[num]["toUpperCase"]() : " ";
- }
- function rebuildAttributes() {
- const result = document["getElementById"]("logo");
- const artistTrack = "url('images/logo.png')";
- const GET_AUTH_URL_TIMEOUT = "url('images/" + meta["key"] + "/logo.png')";
- if (fields["cDisableEventSkins"] || !meta["enabled"]) {
- result["style"]["setProperty"]("--logo", artistTrack, "");
- } else {
- if (meta["enabled"]) {
- result["style"]["setProperty"]("--logo", GET_AUTH_URL_TIMEOUT, "");
- }
- }
- }
- function perform_graphics_ops() {
- obj = new Image;
- b = new Image;
- spike_mother_happy = new Image;
- a = new Image;
- shift();
- bottoms = {};
- gifEmoteList = {};
- var i;
- for (i in _tabInfo) {
- var tx = _tabInfo[i];
- $(".emote-list")["append"]("<li><img name='" + tx + "' title='" + tx + "' src='https://gamedata.gota.io/emotes/" + tx + ".png' /></li>");
- bottoms[tx] = true;
- }
- for (i in blocks) {
- tx = blocks[i];
- $(".gif-list")["append"]("<li><img name='" + tx + "' title='" + tx + "' src='https://gamedata.gota.io/emotes/gifs/" + tx + ".gif' /></li>");
- gifEmoteList[tx] = true;
- }
- i = 0;
- for (; i < lookup["length"]; i++) {
- var key = lookup[i];
- $("#spEffect")["append"]("<option value=" + (i + 1) + ">" + key["charAt"](0)["toUpperCase"]() + key["slice"](1) + "</option>");
- var obj = new Image;
- obj["src"] = "images/ejectedmass_skins/" + key + ".png";
- lookup[i] = obj;
- }
- if (meta["enabled"]) {
- model = new Image;
- model["src"] = "images/" + meta["key"] + "/ejected_mass.png";
- }
- drawImage();
- }
- function shift() {
- if (!fields["cDisableEventSkins"] && meta["enabled"]) {
- var i = "images/" + meta["key"];
- obj["src"] = i + "/spike.png";
- b["src"] = i + "/spike_mother.png";
- spike_mother_happy["src"] = i + "/spike_mother_happy.png";
- if (meta["mother_addon"]["enabled"]) {
- a["src"] = i + "/spike_mother_addon.png";
- }
- } else {
- obj["src"] = "images/spike.png";
- b["src"] = "images/spike_mother.png";
- spike_mother_happy["src"] = "images/spike_mother.png";
- }
- }
- function makeTimeoutHandler() {
- if (!fields["cShowCoordinates"]) {
- $("#minimap-canvas")["css"]({
- "border-top" : "0"
- });
- $("#minimap-panel")["css"]({
- "height" : "250px"
- });
- } else {
- $("#minimap-canvas")["css"]({
- "border-top" : "2px solid rgba(255, 255, 255, .2)"
- });
- $("#minimap-panel")["css"]({
- "height" : "270px"
- });
- }
- }
- function init() {
- die();
- $("#btn-chg-ln")["on"]("click", function() {
- if (!_0x54AD) {
- return;
- }
- var title = prompt("Enter new locked name!");
- if (!title) {
- return;
- }
- var g = null;
- if (typeof title !== "string") {
- g = "Please enter a valid name!";
- }
- if (title["length"] < 2) {
- g = "Locked names must be 2 or more characters long.";
- }
- if (title["length"] > 20) {
- g = "Locked names must be 20 or less characters long.";
- }
- if (g !== null) {
- alert(g);
- return;
- }
- title = title["trim"]();
- 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?")) {
- result["lockedName"] = title;
- getTime();
- self["sendPacket"](new PaintTools["sendSubPanel"]);
- result["lockedName"] = "";
- }
- });
- $("#btn-updateSP")["on"]("click", function() {
- if (!_0x54AD) {
- return;
- }
- getTime();
- self["sendPacket"](new PaintTools["sendSubPanel"]);
- result["lockedName"] = "";
- });
- }
- function die() {
- close();
- $("#spNameColor")["spectrum"]({
- color : result["nameColor"],
- showAlpha : false,
- showInput : true,
- preferredFormat : "rgb"
- });
- $("#spChatColor")["spectrum"]({
- showPaletteOnly : true,
- showPalette : true,
- color : palette[result["chatColor"]],
- palette : palette
- });
- $("#spSkinName")["val"](result["skinName"]);
- $("#spLowerName")["prop"]("checked", result["lowerName"]);
- $("#spEffect select")["val"](result["effect"]);
- }
- function getTime() {
- result["skinName"] = $("#spSkinName")["val"]()["toLowerCase"]();
- result["lowerName"] = $("#spLowerName")["prop"]("checked");
- result["nameColor"] = $("#spNameColor")["spectrum"]("get")["toRgb"]();
- var curRecKey = $("#spChatColor")["spectrum"]("get")["toHexString"]()["toUpperCase"]();
- var overflowValue = 0;
- var modelKeyName = 0;
- for (; modelKeyName < palette["length"]; modelKeyName++) {
- if (palette[modelKeyName] == curRecKey) {
- overflowValue = modelKeyName;
- break;
- }
- }
- result["chatColor"] = overflowValue;
- result["effect"] = parseInt($("#spEffect")["val"]());
- }
- function close() {
- if (result["enabled"] && firebase["auth"]()["currentUser"] !== null) {
- $("#btn-forums")["css"]("display", "none");
- $("#btn-cellpanel")["css"]("display", "block");
- } else {
- $("#btn-cellpanel")["css"]("display", "none");
- $("#btn-forums")["css"]("display", "block");
- }
- }
- function Matrix3(m33, isSlidingUp, $cont, $slides, callback, scopeIn) {
- this["name"] = m33;
- this["ip"] = isSlidingUp;
- this["players"] = $cont;
- this["mode"] = $slides;
- this["region"] = callback;
- this["playersCurrent"] = 0;
- this["ssl"] = scopeIn;
- }
- function removeaToolTip() {
- $("#servers-body-eu")["html"]("");
- $("#servers-body-na")["html"]("");
- $("#servers-body-ap")["html"]("");
- var name;
- for (name in graph) {
- var props = graph[name];
- $("#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>');
- }
- $(".server-row")["on"]("click", function() {
- remove($(this)["attr"]("server"));
- });
- }
- function remove(node) {
- if (children != null) {
- $("#s_" + children["name"])["removeClass"]("server-selected");
- }
- children = graph[node];
- if (children != null) {
- $("#s_" + children["name"])["addClass"]("server-selected");
- }
- }
- function ok(selector) {
- selector = selector["toLowerCase"]();
- var locationMap = $("#server-tab-" + selector);
- $("#server-tab-container")["children"]()["removeClass"]("server-active");
- locationMap["addClass"]("server-active");
- $("#server-content")["children"]()["css"]("display", "none");
- $("#servers-" + selector)["css"]("display", "block");
- }
- function index(obj) {
- var reconnectTryTimes = $("#chat-body tr")["length"];
- if (reconnectTryTimes >= maxReconnectTryTimes) {
- $("#chat-body tr:first-child")["remove"]();
- }
- var callbacks = document["createElement"]("tr");
- callbacks["appendChild"](obj);
- document["getElementById"]("chat-body")["appendChild"](callbacks);
- var result = $("#chat-container");
- if (result[0]["scrollHeight"] - result[0]["scrollTop"] < result["outerHeight"]() + 150) {
- result["scrollTop"](result[0]["scrollHeight"]);
- }
- }
- function fetch(params) {
- if (params["length"] == 0) {
- return;
- } else {
- if (params["charAt"](0) == "/") {
- config(params);
- } else {
- self["sendPacket"](new PaintTools["sendChat"](params, 0));
- $get("");
- }
- }
- }
- function $get(mmCoreSplitViewBlock) {
- $("#chat-input")["val"](mmCoreSplitViewBlock);
- }
- function sendResponses(res) {
- $("#chat-input")["val"](forEach() + res);
- }
- function forEach() {
- return $("#chat-input")["val"]();
- }
- function config(params) {
- var values = params["split"](" ");
- var users = values[0];
- var cast_receivers = users["substring"](1);
- $get("");
- var _0x4AD5 = false;
- Object["keys"](target)["findIndex"]((i) => {
- if (target[i]["triggers"]["findIndex"]((options) => {
- return options["toUpperCase"]() === cast_receivers["toUpperCase"]();
- }) > -1 && _0x4AD5 == false) {
- target[i]["action"](values["slice"](1));
- _0x4AD5 = true;
- return;
- }
- });
- if (_0x4AD5 == false) {
- self["selfMsg"]("Invalid command!");
- }
- }
- function callback(payload, options, value, start) {
- var c = document["getElementById"]("context-name");
- for (; c["firstChild"] != null;) {
- c["removeChild"](c["firstChild"]);
- }
- c["appendChild"](options);
- elem["data"]("selected", value);
- elem["data"]("party", start);
- $(".context-action")["css"]("display", "none");
- if (start == -1) {
- $("#menu-invite")["css"]("display", "block");
- $("#menu-whisper")["css"]("display", "block");
- $("#menu-block")["css"]("display", "block");
- } else {
- $("#menu-whisper")["css"]("display", "block");
- if (self["isPartyLeader"]()) {
- $("#menu-pu_pr")["css"]("display", "block");
- $("#menu-promote")["css"]("display", "block");
- $("#menu-kick")["css"]("display", "block");
- }
- }
- if (self["spectate"]) {
- $("#menu-spectate")["css"]("display", "block");
- }
- elem["css"]("display", "block");
- elem["css"]("left", payload["clientX"]);
- elem["css"]("top", payload["clientY"]);
- }
- function $(str) {
- return str["replace"](/</g, "<")["replace"](/>/g, ">");
- }
- function extend(value, def) {
- var obj = document["createElement"]("canvas");
- var payload = obj["getContext"]("2d");
- var _ = 12;
- var User = "bold " + _ + "pt Times New Roman";
- payload["font"] = User;
- obj["width"] = payload["measureText"](value)["width"] + 4;
- obj["height"] = _ + 5;
- payload["font"] = User;
- payload["fillStyle"] = def;
- payload["fillText"](value, 2, _ + 2);
- return obj;
- }
- function _compareBoundaryPoints(memo, containerB, offsetB, formatters, initialValue, value, range) {
- var futurePrice = (offsetB - self["border"]["left"]) / self["border"]["width"] * popcornMedia["width"];
- var numTiles = (formatters - self["border"]["top"]) / self["border"]["height"] * popcornMedia["height"];
- memo["beginPath"]();
- memo["arc"](futurePrice, numTiles, initialValue, 0, par5, false);
- memo["fillStyle"] = value;
- memo["fill"]();
- if (range) {
- var currentPriceNextPeriod = memo["measureText"](containerB)["width"] / 2;
- var priceDiff = futurePrice - currentPriceNextPeriod;
- var missingRects = numTiles - 5;
- memo["fillText"](containerB, priceDiff, missingRects);
- }
- }
- function resolve(result) {
- var costSum = result["clientX"] * scale / self["scale"] - self["offsetX"];
- var formattedBestGrade = result["clientY"] * scale / self["scale"] - self["offsetY"];
- var object = null;
- var node;
- var i = 0;
- for (; i < self["sorted"]["length"]; i++) {
- node = self["sorted"][i];
- if (node["size"] < 25) {
- continue;
- }
- var clientWidth = node["y"] - node["size"];
- var formattedGradebookGrade = node["y"] + node["size"];
- var clientHeight = node["x"] - node["size"];
- var gasSum = node["x"] + node["size"];
- if (formattedBestGrade > formattedGradebookGrade) {
- continue;
- }
- if (formattedBestGrade < clientWidth) {
- continue;
- }
- if (costSum > gasSum) {
- continue;
- }
- if (costSum < clientHeight) {
- continue;
- }
- object = node;
- break;
- }
- if (object != null && object["playerId"] != 0 && result["target"]["id"] == "canvas") {
- var hash = self["playerRegistry"]["getPlayer"](object["playerId"]);
- if (hash != null) {
- var value = extend(hash["name"], "#fff");
- callback(result, value, object["playerId"], -1);
- }
- }
- }
- function append(item) {
- if (item["css"]("display") == "none") {
- item["css"]("display", "block");
- item["animate"]({
- opacity : 1
- }, 500);
- }
- }
- function find(item) {
- if (item["css"]("display") == "block" && item["css"]("opacity") == 1) {
- item["animate"]({
- opacity : 0
- }, 500, function() {
- item["css"]("display", "none");
- });
- }
- }
- function wrap(x) {
- if (x["css"]("display") == "block" && x["css"]("opacity") == 1) {
- find(x);
- } else {
- if (x["css"]("display") == "none") {
- append(x);
- }
- }
- }
- function startApp(params) {
- return params["css"]("display") === "none";
- }
- function clicked() {
- hist["show"]();
- if (self["party"]["length"] == 0) {
- _attachmentCallbacks["css"]("display", "none");
- }
- if (fields["cHideChat"]) {
- $("#chat-panel")["css"]("display", "none");
- }
- if (fields["cHideMinimap"]) {
- $("#minimap-panel")["css"]("display", "none");
- }
- }
- function refreshFilteredDataSource() {
- hist["hide"]();
- }
- function nunjucksInjector() {
- $("#guest")["hide"]();
- $("#account-loader")["show"]();
- }
- function upld() {
- $("#authed")["hide"]();
- $("#account-loader")["hide"]();
- $("#guest")["show"]();
- }
- function startCircleAnim(options) {
- var j = options["attr"]("id");
- fields[j] = options["prop"]("checked");
- var stop = x[j];
- if (stop != null) {
- stop();
- }
- }
- function bindEvents(component) {
- var id = component["attr"]("id");
- fields[id] = component["val"]();
- var d = x[id];
- if (d != null) {
- d(component["val"]());
- }
- }
- function updater() {
- fields[data[1E3]] = $("#chat-panel")["css"]("width");
- fields["iChatHeight"] = $("#chat-panel")["css"]("height");
- window["localStorage"]["setItem"]("options", JSON["stringify"](fields));
- window["localStorage"]["setItem"]("keybinds", JSON["stringify"](params));
- window["localStorage"]["setItem"]("name", $("#name-box")["val"]());
- window["localStorage"]["setItem"]("interfaceOptions", JSON["stringify"](values));
- window["localStorage"]["setItem"]("subpanel", JSON["stringify"](result));
- }
- function bind() {
- var input = window["localStorage"]["getItem"]("interfaceOptions");
- if (input) {
- input = JSON["parse"](input);
- var i;
- for (i in input) {
- if (input[i] != "") {
- values[i] = input[i];
- }
- }
- }
- $("#cUiForegroundColor")["spectrum"]("set", values["interfaceForegroundColor"]);
- $("#cUiBackgroundColor")["spectrum"]("set", values["interfaceBackgroundColor"]);
- $("#cGameBackground")["spectrum"]("set", values["gameBackgroundColor"]);
- $("#cGridColor")["spectrum"]("set", values["gridColor"]);
- $("#cBorderColor")["spectrum"]("set", values["borderColor"]);
- var userConfig = window["localStorage"]["getItem"]("keybinds");
- if (userConfig) {
- userConfig = JSON["parse"](userConfig);
- for (i in userConfig) {
- if (userConfig[i] != null && Number["isInteger"](userConfig[i])) {
- params[i] = userConfig[i];
- assert($("#" + i));
- }
- }
- }
- var options = window["localStorage"]["getItem"]("options");
- if (options) {
- options = JSON["parse"](options);
- var key;
- for (key in fields) {
- if (!options[key]) {
- options[key] = fields[key];
- }
- }
- } else {
- options = fields;
- }
- for (key in options) {
- var version = key["charAt"](0);
- if (version == "c") {
- if (options[key] == true) {
- var obj = $("#" + key);
- obj["prop"]("checked", options[key]);
- startCircleAnim(obj);
- }
- } else {
- if (version == "s") {
- var that = $("#" + key);
- that["val"](options[key]);
- bindEvents(that);
- } else {
- if (version == "i") {
- fields[key] = options[key];
- }
- }
- }
- }
- $("#chat-panel")["css"]("width", fields[data[1E3]]);
- $("#chat-panel")["css"]("height", fields["iChatHeight"]);
- var artistTrack = window["localStorage"]["getItem"]("name");
- if (artistTrack != null) {
- $("#name-box")["val"](artistTrack);
- }
- var store = window["localStorage"]["getItem"]("subpanel");
- if (store) {
- store = JSON["parse"](store);
- for (key in store) {
- if (store[key] != "") {
- result[key] = store[key];
- }
- }
- }
- result["lockedName"] = "";
- close();
- }
- function calcPrevData(series) {
- var options = series["split"](" ");
- var x = "";
- var tx = null;
- var i = 0;
- for (; i < options["length"]; i++) {
- if (i != 0) {
- x = x + " ";
- }
- tx = options[i];
- if (bottoms[tx] != null) {
- if (tx["startsWith"](":") && tx["endsWith"](":")) {
- tx = tx["substring"](1, tx["length"] - 1);
- }
- x = x + ("<img src='https://gamedata.gota.io/emotes/" + tx + ".png' height='17' width='17' alt='" + tx + ">");
- } else {
- if (gifEmoteList[tx] != null) {
- if (tx["startsWith"](":") && tx["endsWith"](":")) {
- tx = tx["substring"](1, tx["length"] - 1);
- }
- x = x + ("<img src='https://gamedata.gota.io/emotes/gifs/" + tx + ".gif' height='17' width='17' alt='" + tx + "'>");
- } else {
- x = x + tx;
- }
- }
- }
- return x;
- }
- function Store(args) {
- this["particles"] = [];
- this["MAX_PARTICLES"] = args;
- this["init"] = function() {
- var _0x4A99 = 0;
- for (; _0x4A99 < this["MAX_PARTICLES"]; _0x4A99++) {
- var origin = new EventEmitter("images/" + meta["key"] + "/particles.png", Math["floor"](Math["random"]() * 7));
- this["particles"]["push"](origin);
- }
- };
- this["onTick"] = function(elem, n, canCreateDiscussions, isSlidingUp) {
- n = n / 1E3;
- var sGroup;
- for (sGroup in this["particles"]) {
- var obj = this["particles"][sGroup];
- obj["draw"](elem, n);
- }
- };
- this["init"](args);
- }
- function EventEmitter(ctx, events) {
- this["image"] = null;
- this["frame"] = events;
- this["x"] = 0;
- this["y"] = 0;
- this["speed"] = 0;
- this["angle"] = 0;
- this["init"] = function(canCreateDiscussions) {
- this["image"] = new Image;
- this["image"]["src"] = canCreateDiscussions;
- this["x"] = Math["random"]();
- this["y"] = Math["random"]() - 1.25;
- this["speed"] = (Math["random"]() * 7.5E-4 + 5E-4) * 60;
- this["angle"] = 0;
- };
- this["draw"] = function(corePostTags, zr) {
- if (this["y"] > 1) {
- this["y"] = Math["random"]() * -.25 + -.1;
- } else {
- if (this["y"] < -1.25) {
- this["y"] = -1.25;
- }
- }
- if (this["x"] > 1) {
- this["x"] = 0;
- } else {
- if (this["x"] < 0) {
- this["x"] = 1;
- }
- }
- this["angle"] += Math["random"]() * .1 - .05;
- this["angle"] = Math["min"](Math["max"](-.2, this["angle"]), .2);
- var zr2 = zr * this["speed"];
- this["x"] += zr2 * Math["sin"](this["angle"]);
- this["y"] += zr2 * Math["cos"](this["angle"]);
- var pkg = popcornVideo["width"] * this["x"];
- var i = popcornVideo["height"] * this["y"];
- corePostTags["drawImage"](this["image"], 25 * this["frame"], 0, 25, 60, pkg, i, 25, 60);
- };
- this["init"](ctx);
- }
- function Module(_xOff, _yOff, _x) {
- this["name"] = _xOff;
- this["img"] = _yOff;
- this["type"] = _x;
- }
- function drawImage() {
- var i;
- for (i in workers) {
- var rel = workers[i]["img"];
- var n = new Image;
- n["src"] = "images/powerups/" + rel + ".png";
- workers[i]["img"] = n;
- }
- node = new Image;
- node["src"] = "images/debuff.svg";
- }
- function renderTilesTransform() {
- this["passiveBuffs"] = {};
- this["passiveSortedBuffs"] = [];
- this["consumableBuffs"] = [];
- this["cache"] = null;
- this["nextCacheUpdate"] = 0;
- this["bonusMaxCells"] = 0;
- this["onAddBuff"] = function(name, key, value) {
- var result = null;
- var $constraint = workers[name]["type"];
- if ($constraint != $baseDefinition["CONSUMABLE"]) {
- result = this["passiveBuffs"][name];
- if (result) {
- result["update"](key, value);
- } else {
- result = new Error(name, key, value);
- this["passiveBuffs"][name] = result;
- this["sortPassiveBuffs"]();
- }
- this["onPassiveBuffsUpdate"]();
- this["markCacheForUpdate"]();
- } else {
- result = new Error(name, key, value);
- this["consumableBuffs"]["push"](result);
- this["markCacheForUpdate"]();
- }
- if (result) {
- self["selfMsg"]("Recieved buff: " + result["powerup"]["name"]);
- }
- };
- this["onRemoveBuff"] = function(i) {
- var result = null;
- var $constraint = workers[i]["type"];
- if ($constraint != $baseDefinition["CONSUMABLE"]) {
- result = this["passiveBuffs"][i];
- if (result) {
- delete this["passiveBuffs"][i];
- this["sortPassiveBuffs"]();
- this["markCacheForUpdate"]();
- this["onPassiveBuffsUpdate"]();
- }
- } else {
- var namePiece = 0;
- for (; namePiece < this["consumableBuffs"]["length"]; namePiece++) {
- result = this["consumableBuffs"][namePiece];
- if (result["id"] == i) {
- this["consumableBuffs"]["splice"](namePiece, 1);
- this["markCacheForUpdate"]();
- break;
- }
- }
- }
- if (result) {
- self["selfMsg"]("Lost buff: " + result["powerup"]["name"]);
- }
- };
- this["clearBuffs"] = function(easing) {
- if (this["passiveSortedBuffs"]["length"] == 0 && this["consumableBuffs"]["length"] == 0) {
- return;
- }
- var thisEasingType = easing ? easing : false;
- var subjectCount;
- for (subjectCount in this["passiveBuffs"]) {
- var result = this["passiveBuffs"][subjectCount];
- if (thisEasingType && result["powerup"]["type"] == $baseDefinition["MODIFIER"]) {
- } else {
- delete this["passiveBuffs"][subjectCount];
- }
- }
- this["sortPassiveBuffs"]();
- this["onPassiveBuffsUpdate"]();
- this["consumableBuffs"] = [];
- this["markCacheForUpdate"]();
- };
- this["sortPassiveBuffs"] = function() {
- this["passiveSortedBuffs"] = [];
- if (this["passiveBuffs"]["length"] == 0) {
- return;
- }
- var bestIndex;
- for (bestIndex in this["passiveBuffs"]) {
- var result = this["passiveBuffs"][bestIndex];
- if (result["powerup"]["type"] == $baseDefinition["MODIFIER"]) {
- this["passiveSortedBuffs"]["splice"](0, 0, bestIndex);
- } else {
- this["passiveSortedBuffs"]["push"](bestIndex);
- }
- }
- };
- this["onPassiveBuffsUpdate"] = function() {
- this["bonusMaxCells"] = 0;
- if (this["passiveBuffs"][1] != null) {
- var osFamilies = this["passiveBuffs"][1];
- this["bonusMaxCells"] = osFamilies["stack"] * 16;
- }
- };
- this["render"] = function(options) {
- if (this["passiveSortedBuffs"]["length"] == 0 && this["consumableBuffs"]["length"] == 0) {
- return;
- }
- if (Date["now"]() >= this["nextCacheUpdate"]) {
- this["updateCache"]();
- this["nextCacheUpdate"] = Date["now"]() + 1E3;
- }
- options["drawImage"](this["cache"]["canvas"], payload["width"]() + 20, 15);
- };
- this["updateCache"] = function() {
- var popcornVideo = this["cache"] == null || this["cache"]["canvas"] == null ? document["createElement"]("canvas") : this["cache"]["canvas"];
- var damping = Math["max"](this["passiveSortedBuffs"]["length"], this["consumableBuffs"]["length"]);
- popcornVideo["width"] = 55 * damping;
- popcornVideo["height"] = 105;
- this["cache"] = popcornVideo["getContext"]("2d");
- this["cache"]["fillStyle"] = "#222";
- this["cache"]["font"] = "bold 16pt Calibri";
- var val = 0;
- var param = 0;
- var PARENT_NODE = 0;
- for (; PARENT_NODE < this["passiveSortedBuffs"]["length"]; PARENT_NODE++) {
- var node = this["passiveBuffs"][this["passiveSortedBuffs"][PARENT_NODE]];
- node["draw"](this["cache"], val, param);
- val = val + 55;
- }
- val = 0;
- param = 55;
- PARENT_NODE = 0;
- for (; PARENT_NODE < this["consumableBuffs"]["length"]; PARENT_NODE++) {
- node = this["consumableBuffs"][PARENT_NODE];
- node["draw"](this["cache"], val, param);
- val = val + 55;
- }
- this["nextCacheUpdate"] = Date["now"]() + 1E3;
- };
- this["markCacheForUpdate"] = function() {
- this["nextCacheUpdate"] = 0;
- };
- }
- function Error(name, action, app) {
- this["id"] = name;
- this["powerup"] = workers[name];
- this["startTime"] = Date["now"]();
- this["expireTime"] = app;
- this["stack"] = action;
- this["update"] = function(canCreateDiscussions, isSlidingUp) {
- this["startTime"] = Date["now"]();
- this["expireTime"] = isSlidingUp;
- this["stack"] = canCreateDiscussions;
- };
- this["getCooldown"] = function() {
- if (Date["now"]() >= this["expireTime"]) {
- return 2 * Math["PI"];
- } else {
- var delta = this["expireTime"] - Date["now"]();
- var lowestDelta = this["expireTime"] - this["startTime"];
- var _0x4A99 = Math["min"](delta / lowestDelta, 1) * 2;
- return _0x4A99 * Math["PI"];
- }
- };
- this["draw"] = function(scope, value, status) {
- scope["drawImage"](this["powerup"]["img"], value, status, 50, 50);
- if (this["stack"] > 1) {
- scope["fillStyle"] = "#000";
- scope["fillText"](this["stack"], value + 35, status + 17);
- }
- if (this["expireTime"] > 0) {
- scope["beginPath"]();
- scope["moveTo"](value + 25, status + 25);
- scope["arc"](value + 25, status + 25, 25, headers, headers - this["getCooldown"](), false);
- scope["closePath"]();
- scope["globalAlpha"] = .75;
- scope["fillStyle"] = "#222";
- scope["fill"]();
- scope["globalAlpha"] = 1;
- }
- };
- }
- function format(v) {
- return f[v % f["length"]];
- }
- function createNode(v) {
- return f[v % f["length"]];
- }
- function randomMoment(params) {
- var name = params["length"] - 1;
- for (; name > 0; name--) {
- var i = Math["floor"](Math["random"]() * (name + 1));
- var val = params[name];
- params[name] = params[i];
- params[i] = val;
- }
- return params;
- }
- function getByProp(value) {
- if (value === 0 || value === self["playerId"]) {
- return "You cannot block that player.";
- }
- if (object["includes"](value)) {
- delete object[value];
- return "Unblocked player with ID: " + value;
- }
- object["push"](value);
- return "Blocked player with ID: " + value;
- }
- function modelDidAttach(z) {
- return byteToHex[z >> 4 & 15] + byteToHex[z & 15];
- }
- function shouldPreventDefault(deltaX) {
- if (deltaX <= 0) {
- return "0:00";
- }
- var index = Math["floor"](deltaX / 3600);
- var title = Math["floor"]((deltaX - index * 3600) / 60);
- var blue = deltaX - index * 3600 - title * 60;
- if (title < 10 && index > 0) {
- title = "0" + title;
- }
- if (blue < 10) {
- blue = "0" + blue;
- }
- return (index > 0 ? index + ":" : "") + title + ":" + blue;
- }
- function parseFonts() {
- var popcornVideo = localStorage["getItem"]("version");
- var curIncome = version["split"](".");
- if (popcornVideo === null) {
- localStorage["setItem"]("version", version);
- return;
- }
- popcornVideo = popcornVideo["split"](".");
- if (curIncome[0] != popcornVideo[0] || curIncome[1] != popcornVideo[1]) {
- localStorage["setItem"]("version", version);
- find(items);
- append($("#popup-changelog"));
- }
- }
- function Promise() {
- this["playCounter"] = 0;
- this["deathCounter"] = 0;
- this["incrementPlay"] = function() {
- this["playCounter"]++;
- if (this["playCounter"] % 5 == 1) {
- return true;
- } else {
- return false;
- }
- };
- }
- function parseUriConfig() {
- if (typeof aipPlayer != "undefined") {
- adplayer = new aipPlayer({
- AD_WIDTH : 960,
- AD_HEIGHT : 540,
- PREROLL_ELEM : document["getElementById"]("preroll"),
- AIP_COMPLETE : function() {
- if (!self["spectate"]) {
- self["play"]();
- } else {
- self["spec"]();
- }
- }
- });
- } else {
- }
- }
- var popcornVideo;
- var item;
- var popcornMedia;
- var memo;
- var self;
- var PaintTools;
- var minX;
- var array;
- var duedate;
- var obj;
- var b;
- var a;
- var children;
- var items;
- var _attachmentCallbacks;
- var hist;
- var _messageListeners;
- var extendedRegExp;
- var elem;
- var component;
- var state;
- var _0x5D95;
- var bottoms;
- var _self;
- var settings;
- var images;
- var trans;
- var payload;
- var signature;
- var _0x54AD = false;
- var imageX = 0;
- var artistTrack = 0;
- var scale = .5;
- var expected = null;
- var _0x5129 = false;
- var options = {
- elements : [],
- callbacks : [],
- pendingFriends : [],
- timestamps : []
- };
- var object = [];
- const par5 = Math["PI"] * 2;
- const maxReconnectTryTimes = 100;
- const processEvaluatorsCallback = "https://gota.io/topic/updates/";
- const numKeysDeleted = new firebase["auth"]["GoogleAuthProvider"];
- const HOST = "https://accounts.gota.io";
- var meta = {
- key : "birthday_2018",
- foodColors : ["#ca67c5", "#7badfd", "#da7272", "#e9b32a"],
- particles : true,
- particlesMax : 100,
- motd : "",
- endDate : 1529928E6,
- enabled : false,
- mother_addon : {
- enabled : false,
- x_offset : 605 / 531,
- y_offset : 749 / 531
- }
- };
- meta["enabled"] = new Date < meta["endDate"];
- firebase["initializeApp"]({
- apiKey : "AIzaSyCmYFIIazBPyg5goqvPb-7uA6W9-4TVqEM",
- authDomain : "accounts.gota.io",
- databaseURL : "https://gota-io.firebaseio.com",
- projectId : "gota-io",
- storageBucket : "gota-io.appspot.com",
- messagingSenderId : "570450309042"
- });
- firebase["firestore"]()["settings"]({
- timestampsInSnapshots : true
- });
- var graph = {};
- var osFamilies = {
- levelNames : 3,
- levelSkins : 3
- };
- var fields = {
- cAutoRespawn : false,
- cHideId : false,
- cHideServerDisplay : true,
- sShowNames : "ALL",
- sShowSkins : "ALL",
- sQuality : "ULTRA",
- cShowMass : false,
- cShowGrid : false,
- cShowBorder : false,
- cTransCells : false,
- cSilentLogin : false,
- cHideChat : false,
- cTextOutlines : false,
- cHideMinimap : false,
- cShowCoordinates : false,
- cHideFood : false,
- cColoredPing : false,
- cUiEnabled : false,
- cDisableAutoZoom : false,
- cAutoDecline : false,
- cDisableEventSkins : false,
- cResizableChat : false,
- iChatWidth : "360px",
- iChatHeight : "250px"
- };
- var params = {
- kEjectMass : 87,
- kSplit : 32,
- kToggleSpec : 81,
- kDoubleSplit : -1,
- kTripleSplit : -1,
- kQuadSplit : -1
- };
- var _0x5291 = false;
- var values = {
- interfaceForegroundColor : "",
- interfaceBackgroundColor : "",
- gameBackgroundColor : "",
- gridColor : "",
- borderColor : ""
- };
- var defaults = {
- background : "#121212",
- gridColor : "rgb(170, 170, 170)",
- borderColor : "rgb(255, 0, 0)",
- uiBackground : "rgba(23, 22, 23, 0.9)",
- uiForeground : "rgba(255, 255, 255, 1.0)",
- alpha : 1
- };
- var result = {
- enabled : false,
- nameColor : {
- r : 0,
- g : 255,
- b : 255
- },
- chatColor : 0,
- lowerName : false,
- lockedName : "",
- skinName : "",
- effect : 0
- };
- Self.prototype["clearStats"] = function() {
- this["stats"] = {
- name : "An unnamed cell",
- alive : 0,
- eatenFood : 0,
- eatenEject : 0,
- eatenVirus : 0,
- eatenPlayer : 0,
- gainFood : 0,
- gainEject : 0,
- gainVirus : 0,
- gainPlayer : 0
- };
- };
- Self.prototype["play"] = function() {
- if (children == null) {
- this["selfMsg"]("No server selected!");
- return;
- }
- this["name"] = $("#name-box")["val"]();
- this["spectate"] = false;
- this["currentServerName"] = children["name"];
- $("#playerServer")["html"](this["currentServerName"]);
- if (this["isConnected"]() && this["currentServer"] == children["ip"]) {
- this["sendPacket"](new PaintTools["setName"](this["name"]));
- } else {
- this["connect"](children["ip"]);
- }
- clicked();
- find(items);
- ga("send", "event", "Game", "webMenu", "Play");
- };
- Self.prototype["spec"] = function() {
- if (children == null) {
- this["selfMsg"]("No server selected!");
- return;
- }
- this["spectate"] = true;
- if (this["isConnected"]() && this["currentServer"] == children["ip"]) {
- this["sendPacket"](new PaintTools["sendSpectate"]);
- } else {
- this["connect"](children["ip"]);
- }
- clicked();
- find(items);
- ga("send", "event", "Game", "webMenu", "Spectate");
- };
- Self.prototype["login"] = function() {
- var value = $("#id-box")["val"]();
- var privateKey = $("#pw-box")["val"]();
- if (state) {
- var se_model_table_row_ = sha512(value + ":" + sha512(privateKey));
- se_model_table_row_ = sha512(se_model_table_row_ + state);
- var oldCondition = sha512(value);
- } else {
- return;
- }
- var _self = fields["cSilentLogin"] ? 12 : 13;
- this["sendPacket"](new PaintTools["sendLogin"](_self, oldCondition, se_model_table_row_));
- find($("#popup-login"));
- };
- Self.prototype["connect"] = function(query) {
- if (this["socket"] != null) {
- this["socket"]["nextUrl"] = query;
- this["disconnect"](query);
- return;
- }
- this["currentServer"] = query;
- this["currentServerName"] = children["name"];
- this["selfMsg"]("Connecting to " + this["currentServerName"] + "...");
- if (children["ssl"] == 1) {
- this["socket"] = new WebSocket("wss://" + query);
- } else {
- this["socket"] = new WebSocket("ws://" + query);
- }
- this["socket"]["binaryType"] = "arraybuffer";
- var popcornVideo = this;
- this["socket"]["onopen"] = this["onConnect"]["bind"](this);
- this["socket"]["onmessage"] = this["onMessage"]["bind"](this);
- this["socket"]["onclose"] = function(canCreateDiscussions) {
- popcornVideo["reset"]();
- if (this["nextUrl"] != null) {
- popcornVideo["connect"](this["nextUrl"]);
- }
- };
- this["socket"]["onerror"] = function(canCreateDiscussions) {
- popcornVideo["reset"]();
- this["nextUrl"] = null;
- popcornVideo["selfMsg"]("Error connecting to server... Retrying every second.");
- setTimeout(function() {
- if (popcornVideo["isConnected"]() == false && popcornVideo["socket"] == null) {
- popcornVideo["connect"](query);
- }
- }, 1E3);
- };
- };
- Self.prototype["disconnect"] = function(canCreateDiscussions) {
- if (this["socket"] != null) {
- this["socket"]["close"]();
- }
- };
- Self.prototype["reset"] = function() {
- this["bucket"] = {};
- this["sorted"] = [];
- this["foodObjects"] = {};
- this["myCells"] = {};
- this["playerRegistry"]["clear"]();
- this["playerId"] = -1;
- this["rainbow"] = 0;
- this["score"] = 0;
- this["currentServer"] = null;
- this["clearStats"]();
- this["clearParty"]();
- this["buffHolder"]["clearBuffs"]();
- if (this["socket"] != null) {
- this["socket"] = null;
- }
- $("#playerId")["html"](this["playerId"]);
- };
- Self.prototype["isConnected"] = function() {
- if (this["socket"] == null) {
- return false;
- } else {
- return this["socket"]["readyState"] == 1;
- }
- };
- Self.prototype["sendPacket"] = function(mmCoreSplitViewBlock) {
- if (this["isConnected"]()) {
- this["socket"]["send"](mmCoreSplitViewBlock);
- }
- };
- Self.prototype["onConnect"] = function() {
- $("#onesignal-bell-launcher")["css"]("display", "none");
- object = [];
- grecaptcha["execute"]();
- this["sendPacket"](new PaintTools["connectionStart"]);
- this["sendPing"]();
- if (firebase["auth"]()["currentUser"] !== null) {
- firebase["auth"]()["currentUser"]["getIdToken"](true)["then"]((_self) => {
- self["sendPacket"](new PaintTools["sendAuthToken"](_self));
- })["catch"]((name) => {
- return buildJS(name, true);
- });
- return;
- } else {
- if (!this["spectate"]) {
- this["sendPacket"](new PaintTools["setName"](this["name"]));
- } else {
- this["sendPacket"](new PaintTools["sendSpectate"]);
- }
- }
- };
- Self.prototype["sendPing"] = function() {
- if (this["isConnected"]()) {
- duedate = +new Date;
- this["sendPacket"](new PaintTools["sendPing"]);
- }
- };
- Self.prototype["selfMsg"] = function(series) {
- var callbacks = document["createElement"]("td");
- var result = document["createElement"]("span");
- result["style"]["color"] = "#DDDD00";
- result["innerHTML"] = "[System] " + $(series);
- callbacks["appendChild"](result);
- index(callbacks);
- };
- Self.prototype["selfMsgWithJoinCode"] = function(series, forcedSize) {
- var callbacks = document["createElement"]("td");
- var result = document["createElement"]("span");
- result["style"]["color"] = "#DDDD00";
- result["innerHTML"] = "[System] " + $(series);
- callbacks["appendChild"](result);
- var obj = document["createElement"]("span");
- obj["style"]["color"] = "#DDDD00";
- obj["innerHTML"] = forcedSize;
- obj["style"]["pointerEvents"] = "all";
- obj["style"]["userSelect"] = "all";
- callbacks["appendChild"](obj);
- index(callbacks);
- };
- Self.prototype["clearParty"] = function(canCreateDiscussions) {
- this["party"] = [];
- this["partyIds"] = {};
- this["partyLeader"] = -1;
- this["partyIndex"] = -1;
- $("#party-panel")["css"]("display", "none");
- if (trans["css"]("display") == "block") {
- this["handleCustomGameLeave"]();
- }
- if (this["partyCode"] != null || _self != null) {
- this["partyCode"] = _self = null;
- window["history"]["pushState"]("page", "", " ");
- }
- };
- Self.prototype["isPartyLeader"] = function() {
- return this["partyLeader"] == this["playerId"];
- };
- Self.prototype["getServerMaxCells"] = function() {
- return this["serverMaxCells"] + this["buffHolder"]["bonusMaxCells"];
- };
- Self.prototype["onMessage"] = function(options) {
- var raw_basefont = new DataView(options["data"]);
- var _0x4AD5 = raw_basefont["getUint8"](0);
- raw_basefont["offset"] = 1;
- switch(_0x4AD5) {
- case 2:
- this["handleUpdate"](raw_basefont);
- break;
- case 10:
- this["handlePosition"](raw_basefont);
- break;
- case 13:
- this["handleLogin"](raw_basefont);
- break;
- case 21:
- this["handleStats"](raw_basefont);
- break;
- case 22:
- this["showSubPanel"](raw_basefont);
- break;
- case 40:
- this["handleInvite"](raw_basefont);
- break;
- case 41:
- this["handlePartyInfo"](raw_basefont);
- break;
- case 42:
- this["handlePartyData"](raw_basefont);
- break;
- case 43:
- this["handlePartyJoinCode"](raw_basefont);
- break;
- case 49:
- this["handleLeaderboard"](raw_basefont);
- break;
- case 50:
- this["handleLeaderboardCustom"](raw_basefont);
- break;
- case 64:
- this["handleMapData"](raw_basefont);
- break;
- case 65:
- this["handleClearNodes"]();
- break;
- case 66:
- this["handleUpdateBorder"](raw_basefont);
- break;
- case 70:
- this["handleSystemMsg"](raw_basefont);
- break;
- case 71:
- this["handlePing"]();
- break;
- case 72:
- this["handleChat"](raw_basefont);
- break;
- case 73:
- this["handleWhisper"](raw_basefont);
- break;
- case 80:
- this["handleShowScrimmageMenu"]();
- break;
- case 81:
- this["handleQueueData"](raw_basefont);
- break;
- case 82:
- this["handleQueueLeave"](raw_basefont);
- break;
- case 83:
- this["handleMatchState"](raw_basefont);
- break;
- case 90:
- this["handleScrimmageData"](raw_basefont);
- break;
- case 91:
- this["handleCustomGameShow"](raw_basefont);
- break;
- case 92:
- this["handleCustomGameUpdate"](raw_basefont);
- break;
- case 93:
- this["handleCustomGameLeave"]();
- break;
- case 100:
- this["handleAddBuff"](raw_basefont);
- break;
- case 101:
- this["handleRemoveBuff"](raw_basefont);
- break;
- case 102:
- this["handleClearBuffs"](raw_basefont);
- break;
- case 103:
- this["handleAuthenticated"](raw_basefont);
- break;
- }
- };
- Self.prototype["handleUpdate"] = function(item) {
- for (; true;) {
- var i = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- if (i == 0) {
- break;
- }
- var object = this["playerRegistry"]["getPlayer"](i);
- var _0x4AB7 = false;
- if (object == null) {
- object = new Type(i);
- } else {
- _0x4AB7 = true;
- }
- object["cellColor"] = "#" + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++));
- object["name"] = compare(item);
- object["flags"] = item["getUint8"](item["offset"]++);
- if ((object["flags"] & 2) == 2) {
- object["nameColor"] = "#" + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++));
- object["parseEffect"](item["getUint8"](item["offset"]++));
- object["setSkin"](require(item));
- object["cacheUpdate"] = true;
- }
- if (object["skin"] == null) {
- object["setSkin"](object["name"]);
- }
- if (!_0x4AB7) {
- self["playerRegistry"]["add"](object);
- }
- }
- for (; true;) {
- i = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- if (i == 0) {
- break;
- }
- var alwaysDownload = item["getUint8"](item["offset"]++);
- var point;
- if (alwaysDownload == 0) {
- point = this["foodObjects"][i];
- } else {
- point = this["bucket"][i];
- }
- if (point == null) {
- point = new users(i);
- point["setType"](alwaysDownload);
- point["setX"](item["getInt16"](item["offset"], true));
- point["setY"](item["getInt16"](item["offset"] + 2, true));
- item["offset"] += 4;
- switch(alwaysDownload) {
- case 0:
- point["color"] = format(point["id"]);
- break;
- case 1:
- point["setSize"](item["getUint16"](item["offset"], true));
- item["offset"] += 2;
- point["color"] = "#" + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++));
- point["skin"] = item["getUint8"](item["offset"]++) - 1;
- break;
- case 2:
- point["setSize"](item["getUint16"](item["offset"], true));
- item["offset"] += 2;
- point["playerId"] = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- break;
- case 3:
- point["setSize"](item["getUint16"](item["offset"], true));
- item["offset"] += 2;
- break;
- case 4:
- point["setSize"](item["getUint16"](item["offset"], true));
- item["offset"] += 2;
- break;
- case 5:
- point["setSize"](80);
- point["buff"] = item["getUint8"](item["offset"]++);
- break;
- }
- if (alwaysDownload == 0) {
- this["foodObjects"][i] = point;
- } else {
- this["bucket"][i] = point;
- }
- if (point["playerId"] == this["playerId"]) {
- this["myCells"][i] = point;
- }
- } else {
- point["updateX"](item["getInt16"](item["offset"], true));
- point["updateY"](item["getInt16"](item["offset"] + 2, true));
- item["offset"] += 4;
- switch(alwaysDownload) {
- case 0:
- break;
- case 1:
- point["size_"] = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- item["offset"] += 4;
- break;
- case 2:
- point["size_"] = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- item["offset"] += 2;
- break;
- case 3:
- point["size_"] = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- break;
- case 4:
- point["size_"] = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- break;
- case 5:
- item["offset"]++;
- break;
- }
- point["steps"] = 30;
- }
- }
- var _0x4A99 = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- for (; _0x4A99 > 0;) {
- i = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- self["playerRegistry"]["remove"](i);
- _0x4A99--;
- }
- _0x4A99 = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- for (; _0x4A99 > 0;) {
- i = item["getUint16"](item["offset"], true);
- item["offset"] += 2;
- point = this["bucket"][i] || this["foodObjects"][i];
- if (point != null) {
- if (point["type"] == 0) {
- delete this["foodObjects"][i];
- } else {
- delete this["bucket"][i];
- }
- if (point["playerId"] == this["playerId"]) {
- delete this["myCells"][i];
- if (Object["keys"](this["myCells"])["length"] == 0) {
- if (fields["cAutoRespawn"]) {
- if ($("#main")["css"]("display") == "none") {
- self["play"]();
- }
- } else {
- if (extendedRegExp["css"]("display") != "block") {
- append(items);
- }
- aiptag["cmd"]["display"]["push"](function() {
- aipDisplayTag["refresh"]("GOT_gota-io_336x280");
- });
- }
- }
- }
- }
- _0x4A99--;
- }
- this["sortCells"]();
- };
- Self.prototype["handlePosition"] = function(options) {
- this["centerX_"] = options["getFloat32"](options["offset"], true);
- options["offset"] += 4;
- this["centerY_"] = options["getFloat32"](options["offset"], true);
- options["offset"] += 4;
- this["centerSteps"] = 30;
- if (!fields["cDisableAutoZoom"]) {
- this["scale_base"] = options["getFloat32"](options["offset"], true);
- }
- };
- Self.prototype["handleMapData"] = function(item) {
- this["playerId"] = item["getUint16"](item["offset"], true);
- item["offset"] += 2 + 1;
- this["handleUpdateBorder"](item);
- this["serverMaxCells"] = item["getUint8"](item["offset"]++);
- $("#playerId")["html"](self["playerId"]);
- $("#playerCells")["html"]("0/" + this["getServerMaxCells"]());
- if (_self != null) {
- self["sendPacket"](new PaintTools["sendPartyJoin"](_self));
- }
- extendedRegExp["css"]("display", "none");
- $("#scrimmage-btn-leave")["css"]("display", "none");
- };
- Self.prototype["handleUpdateBorder"] = function(options) {
- this["border"] = {};
- this["border"]["left"] = options["getInt16"](options["offset"], true);
- this["border"]["top"] = options["getInt16"](options["offset"] + 2, true);
- this["border"]["right"] = options["getInt16"](options["offset"] + 4, true);
- this["border"]["bottom"] = options["getInt16"](options["offset"] + 6, true);
- options["offset"] += 8;
- this["border"]["width"] = this["border"]["right"] - this["border"]["left"];
- this["border"]["height"] = this["border"]["bottom"] - this["border"]["top"];
- this["border"]["enabled"] = this["border"]["width"] != 0 && this["border"]["height"] != 0;
- };
- Self.prototype["handleClearNodes"] = function(canCreateDiscussions) {
- if (Object["keys"](this["bucket"])["length"] > 0) {
- this["bucket"] = {};
- }
- if (Object["keys"](this["foodObjects"])["length"] > 0) {
- this["foodObjects"] = {};
- }
- if (Object["keys"](this["myCells"])["length"] > 0) {
- this["bucket"] = {};
- }
- };
- Self.prototype["handleLeaderboard"] = function(options) {
- var popcornVideo = document["getElementById"]("leaderboard-canvas");
- var item = popcornVideo["getContext"]("2d");
- _messageListeners["html"]("Leaderboard");
- var cell_amount = options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- popcornVideo["width"] = 200;
- popcornVideo["height"] = 20 * cell_amount + 5;
- item["font"] = "16px Calibri";
- var maxLen = 20;
- var i = 0;
- for (; i < cell_amount; i++) {
- var indexLookupKey = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- var _0x4B2F = compare(options) || "An unnamed cell";
- if (indexLookupKey == this["playerId"]) {
- item["fillStyle"] = "#FFAAAA";
- } else {
- if (this["partyIds"][indexLookupKey] != null) {
- item["fillStyle"] = "#FFFF00";
- } else {
- item["fillStyle"] = values["interfaceForegroundColor"];
- }
- }
- item["fillText"](i + 1 + ". " + _0x4B2F, 5, maxLen);
- maxLen = maxLen + 20;
- }
- };
- Self.prototype["handleLeaderboardCustom"] = function(options) {
- var popcornVideo = document["getElementById"]("leaderboard-canvas");
- var item = popcornVideo["getContext"]("2d");
- _messageListeners["html"]("Leaderboard");
- var clientHeight = options["getUint16"](options["offset"], true);
- var river = options["getUint8"](options["offset"] + 2, true);
- var EOL = options["getUint8"](options["offset"] + 3, true);
- options["offset"] += 4;
- popcornVideo["width"] = 200;
- popcornVideo["height"] = 20 * clientHeight + 5 + (EOL != 0 ? 40 : 0);
- item["font"] = "16px Calibri";
- var maxLen = 20;
- var stripTerrain = 0;
- for (; stripTerrain < clientHeight; stripTerrain++) {
- var child = require(options);
- if (stripTerrain == river) {
- item["fillStyle"] = "#FFAAAA";
- } else {
- item["fillStyle"] = values["interfaceForegroundColor"];
- }
- item["fillText"](child, 5, maxLen);
- maxLen = maxLen + 20;
- }
- if (EOL != 0) {
- maxLen = maxLen + 20;
- item["fillText"]("Respawn: " + EOL, 5, maxLen);
- }
- };
- Self.prototype["handlePing"] = function() {
- var timeSubmittedDiff = +new Date - duedate;
- if (!fields["cColoredPing"]) {
- if (timeSubmittedDiff < 100) {
- $("#playerPing")["css"]({
- "color" : "#00ff00"
- });
- } else {
- if (timeSubmittedDiff < 150) {
- $("#playerPing")["css"]({
- "color" : "#ffff00"
- });
- } else {
- if (timeSubmittedDiff < 200) {
- $("#playerPing")["css"]({
- "color" : "#ff6600"
- });
- } else {
- if (timeSubmittedDiff > 200) {
- $("#playerPing")["css"]({
- "color" : "#ff0000"
- });
- }
- }
- }
- }
- } else {
- $("#playerPing")["css"]({
- "color" : defaults["uiForeground"]
- });
- }
- $("#playerPing")["html"](timeSubmittedDiff + "ms");
- };
- Self.prototype["handleChat"] = function(options) {
- var _0x4A99 = options["getUint8"](options["offset"]++);
- var expanded = "rgb(" + options["getUint8"](options["offset"]++) + "," + options["getUint8"](options["offset"]++) + "," + options["getUint8"](options["offset"]++) + ")";
- var j = options["getUint8"](options["offset"]++);
- var value = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- if (object["includes"](value)) {
- return;
- }
- var ms = require(options);
- var attribute = compare(options) || "An unnamed cell";
- var series = $(compare(options));
- var title;
- switch(_0x4A99) {
- case 1:
- title = "Party";
- break;
- case 2:
- title = "Admin";
- break;
- default:
- title = "All";
- break;
- }
- if (ms["length"] > 0) {
- $(title = title + (" - " + ms));
- }
- var callbacks = document["createElement"]("td");
- var params = document["createElement"]("span");
- params["innerHTML"] = "[" + title + "] ";
- callbacks["appendChild"](params);
- var result = extend(attribute, expanded);
- result["dataset"]["playerId"] = value;
- result["oncontextmenu"] = getListed;
- result["style"]["userSelect"] = "none";
- callbacks["appendChild"](result);
- var node = document["createElement"]("span");
- node["style"]["color"] = palette[j];
- if (j == 0) {
- node["innerHTML"] = ": " + calcPrevData(series);
- } else {
- var params = document["createElement"]("span");
- params["innerHTML"] = ": ";
- callbacks["appendChild"](params);
- node["innerHTML"] = calcPrevData(series);
- }
- callbacks["appendChild"](node);
- index(callbacks);
- };
- Self.prototype["handleWhisper"] = function(style) {
- var attribute = compare(style) || "An unnamed cell";
- style["offset"] += 2;
- var expanded = "rgb(" + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + ")";
- var level = compare(style) || "An unnamed cell";
- style["offset"] += 2;
- var start = "rgb(" + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + ")";
- var series = $(compare(style));
- var callbacks = document["createElement"]("td");
- var result = extend(attribute, expanded);
- result["style"]["userSelect"] = "none";
- callbacks["appendChild"](result);
- var params = document["createElement"]("span");
- params["innerHTML"] = " > ";
- callbacks["appendChild"](params);
- var node = extend(level, start);
- node["style"]["userSelect"] = "none";
- callbacks["appendChild"](node);
- var options = document["createElement"]("span");
- options["innerHTML"] = ": " + calcPrevData(series);
- callbacks["appendChild"](options);
- index(callbacks);
- };
- Self.prototype["handleSystemMsg"] = function(password) {
- var ret = compare(password);
- this["selfMsg"](ret);
- };
- Self.prototype["handleLogin"] = function(options) {
- var _0x4A99 = options["getUint8"](1);
- switch(_0x4A99) {
- case 0:
- break;
- case 1:
- alert("Invalid id or password!");
- $("#id-box")["val"]("");
- $("#pw-box")["val"]("");
- append(items);
- break;
- }
- append($("#popup-login"));
- $("#id-box")["focus"]();
- state = options["getUint32"](2, true);
- };
- Self.prototype["handleAuthenticated"] = function(options) {
- var _0x4A99 = options["getUint8"](1);
- switch(_0x4A99) {
- case generatedSeries["SUCCESS"]:
- break;
- case generatedSeries["FAILURE"]:
- this["selfMsg"]("Invalid authentication token! Please logout and try again!");
- break;
- }
- if (result["enabled"]) {
- this["sendPacket"](new PaintTools["sendSubPanel"]);
- }
- if (!this["spectate"]) {
- this["sendPacket"](new PaintTools["setName"](this["name"]));
- } else {
- this["sendPacket"](new PaintTools["sendSpectate"]);
- }
- };
- Self.prototype["handleInvite"] = function(password) {
- if (fields["cAutoDecline"]) {
- self["sendPacket"](new PaintTools["sendInviteResponse"](false));
- } else {
- var ret = compare(password);
- var domain = extend(ret + " has invited you to a party.", "#FFFFFF");
- var self = document["getElementById"]("popup-party-text");
- for (; self["firstChild"] != null;) {
- self["removeChild"](self["firstChild"]);
- }
- self["appendChild"](domain);
- append($("#popup-party"));
- }
- };
- Self.prototype["handlePartyInfo"] = function(options) {
- var specialChars = {};
- var TYPES = [];
- var codeGeneratorFunc = -1;
- var clientHeight = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- var targetOffsetHeight = 0;
- for (; targetOffsetHeight < clientHeight; targetOffsetHeight++) {
- var node = {};
- var _0x4AB7 = options["getUint8"](options["offset"]++);
- node["id"] = options["getUint16"](options["offset"], true);
- specialChars[node["id"]] = targetOffsetHeight;
- options["offset"] += 2;
- if (_0x4AB7 == 1) {
- node["color"] = "#00FFFF";
- codeGeneratorFunc = node["id"];
- } else {
- node["color"] = defaults["uiForeground"];
- }
- node["name"] = compare(options) || "An unnamed cell";
- node["x"] = 0;
- node["y"] = 0;
- node["x_"] = 0;
- node["y_"] = 0;
- node["score"] = 0;
- node["cache"] = -1;
- node["team"] = 0;
- if (this["partyIds"][node["id"]] != null) {
- var hash = this["party"][this["partyIds"][node["id"]]];
- node["x"] = hash["x"];
- node["y"] = hash["y"];
- node["x_"] = hash["x_"];
- node["y_"] = hash["y_"];
- node["mmColor"] = hash["mmColor"];
- } else {
- node["mmColor"] = createNode(node["id"]);
- }
- TYPES["push"](node);
- }
- this["party"] = TYPES;
- this["partyIds"] = specialChars;
- if (this["partyLeader"] != codeGeneratorFunc) {
- this["partyLeader"] = codeGeneratorFunc;
- if (trans["css"]("display") == "block") {
- ScrimmageHelper["checkLeader"]();
- }
- }
- if (clientHeight > 0) {
- this["drawParty"]();
- } else {
- this["clearParty"]();
- }
- };
- Self.prototype["handlePartyData"] = function(options) {
- var addressCount = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- if (addressCount != this["party"]["length"]) {
- return;
- }
- var signedTransactionsCounter = 0;
- for (; signedTransactionsCounter < addressCount; signedTransactionsCounter++) {
- var payload = this["party"][signedTransactionsCounter];
- payload["x_"] = options["getInt16"](options["offset"], true);
- payload["y_"] = options["getInt16"](options["offset"] + 2, true);
- payload["score"] = options["getInt32"](options["offset"] + 4, true);
- options["offset"] += 8;
- }
- this["drawParty"]();
- };
- Self.prototype["handlePartyJoinCode"] = function(level) {
- var ent = require(level);
- this["partyCode"] = require(level);
- if (this["partyCode"]["length"] != 0) {
- this["selfMsgWithJoinCode"](ent, this["partyCode"]);
- $("#popup-party-code-content input")["val"](this["partyCode"]);
- $("#popup-party-code")["show"]();
- var GET_AUTH_URL_TIMEOUT = "#" + this["currentServerName"] + "&" + this["partyCode"];
- window["history"]["pushState"]("page", "", GET_AUTH_URL_TIMEOUT);
- } else {
- this["selfMsg"](ent);
- this["partyCode"] = null;
- window["history"]["pushState"]("page", "", " ");
- }
- };
- Self.prototype["handleStats"] = function(options) {
- var key = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- this["stats"]["name"] = compare(options) || "An unnamed cell";
- this["stats"]["alive"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["eatenFood"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["eatenEject"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["eatenVirus"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["eatenPlayer"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["gainFood"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["gainEject"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["gainVirus"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- this["stats"]["gainPlayer"] += options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- var locationMap = $("#main-stats");
- locationMap["empty"]();
- locationMap["append"]("<span>Name: " + this["stats"]["name"] + " (" + key + ")</span><br>");
- locationMap["append"]("<span>Alive: " + this["stats"]["alive"] + "</span><br>");
- locationMap["append"]("<span>Food eaten: " + this["stats"]["eatenFood"] + " (" + this["stats"]["gainFood"] + ")</span><br>");
- locationMap["append"]("<span>Ejected mass eaten: " + this["stats"]["eatenEject"] + " (" + this["stats"]["gainEject"] + ")</span><br>");
- locationMap["append"]("<span>Viruses eaten: " + this["stats"]["eatenVirus"] + " (" + this["stats"]["gainVirus"] + ")</span><br>");
- locationMap["append"]("<span>Player cells eaten: " + this["stats"]["eatenPlayer"] + " (" + this["stats"]["gainPlayer"] + ")</span><br>");
- };
- Self.prototype["showSubPanel"] = function(canCreateDiscussions) {
- result["enabled"] = true;
- updater();
- close();
- _0x54AD = true;
- $("#recaptcha")["css"]("display", "none");
- grecaptcha["reset"]();
- };
- Self.prototype["handleAddBuff"] = function(options) {
- var artistTrack = options["getUint8"](options["offset"]++);
- var GET_AUTH_URL_TIMEOUT = options["getUint8"](options["offset"]++);
- var numKeysDeleted = options["getFloat64"](options["offset"], true);
- options["offset"] += 8;
- this["buffHolder"]["onAddBuff"](artistTrack, GET_AUTH_URL_TIMEOUT, numKeysDeleted);
- };
- Self.prototype["handleRemoveBuff"] = function(options) {
- var artistTrack = options["getUint8"](options["offset"]++);
- this["buffHolder"]["onRemoveBuff"](artistTrack);
- };
- Self.prototype["handleClearBuffs"] = function(options) {
- var artistTrack = options["getUint8"](options["offset"]++) == 1 ? true : false;
- this["buffHolder"]["clearBuffs"](artistTrack);
- };
- Self.prototype["sortCells"] = function() {
- this["sorted"] = [];
- var this_stream;
- var _0x4AF3;
- var conditionName;
- for (conditionName in this["bucket"]) {
- this_stream = this["bucket"][conditionName];
- if (this["sorted"]["length"] == 0) {
- this["sorted"]["push"](this_stream);
- } else {
- _0x4AF3 = false;
- conditionName = 0;
- for (; conditionName < this["sorted"]["length"]; conditionName++) {
- var conditionVariable = this["sorted"][conditionName];
- if (this_stream["size"] > conditionVariable["size"]) {
- this["sorted"]["splice"](conditionName, 0, this_stream);
- _0x4AF3 = true;
- break;
- }
- }
- if (!_0x4AF3) {
- this["sorted"]["push"](this_stream);
- }
- }
- }
- var _0x4AD5 = 0;
- var origoy = 0;
- for (conditionName in this["myCells"]) {
- this_stream = this["myCells"][conditionName];
- _0x4AD5 = _0x4AD5 + this_stream["getRealMass"]();
- origoy++;
- }
- if (_0x4AD5 > this["score"]) {
- this["score"] = _0x4AD5;
- $("#playerScore")["html"](this["score"]);
- }
- $("#playerCells")["html"](origoy + "/" + this["getServerMaxCells"]());
- };
- Self.prototype["drawParty"] = function() {
- if (_attachmentCallbacks["css"]("display") == "none" && hist["css"]("display") != "none") {
- _attachmentCallbacks["css"]("display", "block");
- }
- var popcornVideo = document["getElementById"]("party-canvas");
- var obj = popcornVideo["getContext"]("2d");
- obj["font"] = "16px Calibri";
- var v_max = 0;
- var lastChecksumFailCount = 0;
- var i = 0;
- for (; i < this["party"]["length"]; i++) {
- var item = this["party"][i];
- if (item["cache"] == -1) {
- item["cache"] = obj["measureText"](i + 1 + ". " + item["name"])["width"];
- }
- if (item["cache"] > v_max) {
- v_max = item["cache"];
- }
- var currentChecksumFailCount = obj["measureText"](item["score"])["width"];
- if (currentChecksumFailCount > lastChecksumFailCount) {
- lastChecksumFailCount = currentChecksumFailCount;
- }
- }
- popcornVideo["width"] = 15 + v_max + 50 + lastChecksumFailCount;
- popcornVideo["height"] = 20 * this["party"]["length"] + 5;
- obj["font"] = "16px Calibri";
- var p3 = 20;
- var deep = 5 + v_max + 50;
- i = 0;
- for (; i < this["party"]["length"]; i++) {
- item = this["party"][i];
- obj["fillStyle"] = item["color"];
- obj["fillText"](i + 1 + ". " + item["name"], 5, p3);
- obj["fillText"]("" + item["score"], deep, p3);
- p3 = p3 + 20;
- }
- };
- Self.prototype["handleShowScrimmageMenu"] = function() {
- items["stop"](true, false);
- items["css"]("display", "none");
- extendedRegExp["css"]("display", "block");
- $("#scrimmage-btn-leave")["css"]("display", "none");
- self["border"]["enabled"] = false;
- };
- Self.prototype["handleQueueData"] = function(options) {
- var value = require(options);
- var differenceX = options["getUint32"](options["offset"], true);
- options["offset"] += 4;
- var EOL = options["offset"] < options["byteLength"] ? options["getUint8"](options["offset"]) : -1;
- var popcornVideo = document["getElementById"]("leaderboard-canvas");
- var item = popcornVideo["getContext"]("2d");
- _messageListeners["html"]("Queue");
- popcornVideo["width"] = 200;
- popcornVideo["height"] = 20 * (2 + (EOL != -1 ? 1 : 0)) + 5;
- item["font"] = "16px Calibri";
- var maxLen = 20;
- item["fillStyle"] = values["interfaceForegroundColor"];
- item["fillText"]("Mode: " + value, 5, maxLen);
- maxLen = maxLen + 20;
- item["fillText"]("Time: " + shouldPreventDefault(differenceX), 5, maxLen);
- if (EOL != -1) {
- maxLen = maxLen + 20;
- item["fillText"]("Queued players: " + EOL, 5, maxLen);
- }
- };
- Self.prototype["handleQueueLeave"] = function(lodash) {
- var _ = require(lodash);
- var popcornVideo = document["getElementById"]("leaderboard-canvas");
- var _0x4A99 = popcornVideo["getContext"]("2d");
- popcornVideo["width"] = 0;
- popcornVideo["height"] = 0;
- this["selfMsg"]("You have left the queue for [" + _ + "]");
- };
- Self.prototype["handleMatchState"] = function(options) {
- var _0x4A99 = options["byteLength"] == 1 ? 0 : options["getUint8"](options["offset"]++);
- if (_0x4A99 == 0) {
- this["selfMsg"]("A match has been found. Good luck and have fun!");
- } else {
- if (_0x4A99 == 1) {
- $("#scrimmage-btn-leave")["css"]("display", "block");
- }
- }
- };
- Self.prototype["handleScrimmageData"] = function(f) {
- var _0x4A99 = f["getUint8"](f["offset"]++);
- var params = $("#scrimmage-mode-select");
- var locationMap = $("#scrimmage-mode-info");
- params["empty"]();
- locationMap["empty"]();
- for (; _0x4A99 > 0;) {
- var i = f["getUint8"](f["offset"]++);
- var s = require(f);
- var version = require(f);
- var result = document["createElement"]("option");
- result["innerHTML"] = s;
- result["value"] = i;
- params["append"](result);
- result = document["createElement"]("div");
- result["innerHTML"] = version;
- result["id"] = "scrimmage-info-" + i;
- result["style"]["display"] = "none";
- locationMap["append"](result);
- _0x4A99--;
- }
- params["prop"]("selectedIndex", 0);
- params["trigger"]("change");
- images = {
- "modes" : {},
- "sizes" : {},
- "maps" : []
- };
- if (f["byteLength"] - 1 > f["offset"]) {
- _0x4A99 = f["getUint8"](f["offset"]++);
- for (; _0x4A99 > 0;) {
- i = f["getUint8"](f["offset"]++);
- s = require(f);
- images["modes"][i] = {
- "id" : i,
- "name" : s
- };
- _0x4A99--;
- }
- _0x4A99 = f["getUint8"](f["offset"]++);
- for (; _0x4A99 > 0;) {
- i = f["getUint8"](f["offset"]++);
- s = require(f);
- images["sizes"][i] = {
- "id" : i,
- "name" : s
- };
- _0x4A99--;
- }
- _0x4A99 = f["getUint8"](f["offset"]++);
- for (; _0x4A99 > 0;) {
- s = require(f);
- var result = {
- "name" : s,
- "startmass" : 0,
- "modes" : [],
- "sizes" : []
- };
- var rel = f["getUint8"](f["offset"]++);
- for (; rel > 0;) {
- result["modes"]["push"](f["getUint8"](f["offset"]++));
- rel--;
- }
- rel = f["getUint8"](f["offset"]++);
- for (; rel > 0;) {
- result["sizes"]["push"](f["getUint8"](f["offset"]++));
- rel--;
- }
- result["startmass"] = f["getUint16"](f["offset"], true);
- f["offset"] += 2;
- images["maps"]["push"](result);
- _0x4A99--;
- }
- }
- $("#scrimmage-custom-btn-container")["css"]("display", images["maps"]["length"] == 0 ? "none" : "block");
- $("#scrimmage-map")["empty"]();
- rel = 0;
- for (; rel < images["maps"]["length"]; rel++) {
- $("#scrimmage-map")["append"]("<option value='" + rel + "'>" + images["maps"][rel]["name"] + "</option>");
- }
- };
- Self.prototype["handleCustomGameUpdate"] = function(options) {
- var _0x4AD5 = options["getUint8"](options["offset"]++);
- switch(_0x4AD5) {
- case style["MAP"]:
- ScrimmageHelper["updateMap"](options["getUint8"](options["offset"]++));
- break;
- case style["MODE"]:
- ScrimmageHelper["updateMode"](options["getUint8"](options["offset"]++));
- break;
- case style["SIZE"]:
- ScrimmageHelper["updateSize"](options["getUint8"](options["offset"]++));
- break;
- case style["STARTMASS"]:
- ScrimmageHelper["updateStartMass"](options["getUint16"](options["offset"], true));
- options["offset"] += 2;
- break;
- case style["LOCK"]:
- ScrimmageHelper["updateLock"](options["getUint8"](options["offset"]++) == 0 ? true : false);
- break;
- case style["PLAYER_UPGame"]:
- var i = options["getUint8"](options["offset"]++);
- var _0x4AF3 = options["getUint8"](options["offset"]++);
- self["party"][i]["team"] = _0x4AF3;
- ScrimmageHelper["updatePlayerById"](i);
- break;
- case style["PLAYER_LIST"]:
- var _0x4A99 = options["getUint8"](options["offset"]++);
- i = 0;
- for (; _0x4A99 > 0;) {
- self["party"][i]["team"] = options["getUint8"](options["offset"]++);
- _0x4A99--;
- i++;
- }
- ScrimmageHelper["updatePlayers"]();
- break;
- }
- };
- Self.prototype["handleCustomGameShow"] = function(options) {
- $("#scrimmage-menu")["css"]("display", "none");
- $("#scrimmage-custom")["css"]("display", "block");
- var artistTrack = options["getUint8"](options["offset"]++);
- var GET_AUTH_URL_TIMEOUT = options["getUint8"](options["offset"]++);
- var numKeysDeleted = options["getUint8"](options["offset"]++);
- var postDateGmt = options["getUint16"](options["offset"], true);
- options["offset"] += 2;
- var _maskLayer = options["getUint8"](options["offset"]++) == 0 ? true : false;
- var _0x4A99 = options["getUint8"](options["offset"]++);
- var i = 0;
- for (; _0x4A99 > 0;) {
- self["party"][i]["team"] = options["getUint8"](options["offset"]++);
- _0x4A99--;
- i++;
- }
- ScrimmageHelper["updateMap"](artistTrack);
- ScrimmageHelper["updateMode"](GET_AUTH_URL_TIMEOUT);
- ScrimmageHelper["updateSize"](numKeysDeleted);
- ScrimmageHelper["updateStartMass"](postDateGmt);
- ScrimmageHelper["updateLock"](_maskLayer);
- ScrimmageHelper["updatePlayers"]();
- ScrimmageHelper["checkLeader"]();
- };
- Self.prototype["handleCustomGameLeave"] = function() {
- $("#scrimmage-custom")["css"]("display", "none");
- $("#scrimmage-menu")["css"]("display", "block");
- };
- ScrimmageHelper = {
- updateMap : function(target) {
- $("#scrimmage-map option[value='" + target + "']")["prop"]("selected", true);
- var result = images["maps"][target];
- $("#scrimmage-mapmode")["empty"]();
- var rel = 0;
- for (; rel < result["modes"]["length"]; rel++) {
- var osFamilies = images["modes"][result["modes"][rel]];
- $("#scrimmage-mapmode")["append"]("<option value='" + rel + "'>" + osFamilies["name"] + "</option>");
- }
- $("#scrimmage-mapsize")["empty"]();
- rel = 0;
- for (; rel < result["sizes"]["length"]; rel++) {
- var osFamilies = images["sizes"][result["sizes"][rel]];
- $("#scrimmage-mapsize")["append"]("<option value='" + rel + "'>" + osFamilies["name"] + "</option>");
- }
- ScrimmageHelper["updateMode"](0);
- ScrimmageHelper["updateSize"](0);
- ScrimmageHelper["updateStartMass"](result["startmass"]);
- $("#scrimmage-startmass")["attr"]("placeholder", result["startmass"]);
- $("#scrimmage-map")["attr"]("data", target);
- },
- updateMode : function(rel) {
- $("#scrimmage-mapmode option[value='" + rel + "']")["prop"]("selected", true);
- $("#scrimmage-mapmode")["attr"]("data", rel);
- },
- updateSize : function(rel) {
- $("#scrimmage-mapsize option[value='" + rel + "']")["prop"]("selected", true);
- $("#scrimmage-mapsize")["attr"]("data", rel);
- },
- updateStartMass : function(mmCoreSplitViewBlock) {
- $("#scrimmage-startmass")["val"](mmCoreSplitViewBlock);
- $("#scrimmage-startmass")["attr"]("data", mmCoreSplitViewBlock);
- },
- updateLock : function(value) {
- $("#scrimmage-lockteams")["prop"]("checked", value);
- ScrimmageHelper["checkLock"]();
- },
- checkLock : function() {
- if ($("#scrimmage-lockteams")["prop"]("checked") && !self["isPartyLeader"]()) {
- $("#cgp-" + self["partyIndex"])["attr"]("disabled", "disabled");
- } else {
- $("#cgp-" + self["partyIndex"])["removeAttr"]("disabled");
- }
- },
- checkLeader : function() {
- if (self["isPartyLeader"]()) {
- $(".custom-game")["removeAttr"]("disabled");
- } else {
- $(".custom-game")["attr"]("disabled", "disabled");
- ScrimmageHelper["checkLock"]();
- }
- },
- updatePlayerById : function(rel) {
- var releases = self["party"][rel];
- $("#cgp-" + rel + " option[value='" + releases["team"] + "']")["prop"]("selected", true);
- $("#cgp-name-" + rel)["text"](releases["name"]);
- $("#cgp-name-" + rel)["css"]("color", moodleReleases[releases["team"]]);
- },
- updatePlayers : function() {
- $("#scrimmage-custom-players")["empty"]();
- var type = 0;
- for (; type < self["party"]["length"]; type++) {
- var palette = self["party"][type];
- if (palette["id"] == self["playerId"]) {
- self["partyIndex"] = type;
- }
- $("#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>");
- $("#cgp-" + type + " option[value='" + palette["team"] + "']")["prop"]("selected", true);
- $("#cgp-name-" + type)["css"]("color", moodleReleases[palette["team"]]);
- $("#cgp-" + type)["on"]("change", function(canCreateDiscussions) {
- var i = parseInt($(this)["attr"]("id")["match"]("\d+")[0]);
- var _0x4AF3 = $(this)["find"]("option:selected")["val"]();
- $("#cgp-" + type + " option[value='" + $(this)["attr"]("data") + "']")["prop"]("selected", true);
- if (self["party"][i]["id"] == self["playerId"]) {
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["PLAYER_UPGame_SELF"], 0, _0x4AF3));
- } else {
- self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["PLAYER_UPGame"], i, _0x4AF3));
- }
- });
- }
- ScrimmageHelper["checkLeader"]();
- }
- };
- users.prototype["setType"] = function(canCreateDiscussions) {
- this["type"] = canCreateDiscussions;
- };
- users.prototype["setX"] = function(canCreateDiscussions) {
- this["x_"] = canCreateDiscussions;
- this["x"] = canCreateDiscussions;
- };
- users.prototype["setY"] = function(canCreateDiscussions) {
- this["y_"] = canCreateDiscussions;
- this["y"] = canCreateDiscussions;
- };
- users.prototype["updateX"] = function(canCreateDiscussions) {
- this["x_"] = canCreateDiscussions;
- };
- users.prototype["updateY"] = function(canCreateDiscussions) {
- this["y_"] = canCreateDiscussions;
- };
- users.prototype["setSize"] = function(canCreateDiscussions) {
- this["size_"] = canCreateDiscussions;
- this["size"] = canCreateDiscussions;
- };
- users.prototype["getMass"] = function() {
- return this["size"] * this["size"] / 100 >> 0;
- };
- users.prototype["getRealMass"] = function() {
- return this["size_"] * this["size_"] / 100 >> 0;
- };
- users.prototype["animate"] = function(factor) {
- this["x"] += Math["round"]((this["x_"] - this["x"]) * factor);
- this["y"] += Math["round"]((this["y_"] - this["y"]) * factor);
- this["size"] += Math["round"]((this["size_"] - this["size"]) * factor);
- this["steps"]--;
- };
- users.prototype["getSizeCache"] = function() {
- var popcornVideo;
- if (this["cache"] == null || this["cache"]["canvas"] == null) {
- popcornVideo = document["createElement"]("canvas");
- this["cache"] = popcornVideo["getContext"]("2d");
- } else {
- popcornVideo = this["cache"]["canvas"];
- }
- var this_stream = this["getMass"]();
- if (this_stream != this["massLastAmount"] || this["massLastAmount"] < 0) {
- var artistTrack = this_stream["toString"]();
- var val = 54;
- var size_human = "bold 54pt Verdana";
- this["cache"]["font"] = size_human;
- popcornVideo["width"] = this["cache"]["measureText"](artistTrack)["width"] + 4;
- popcornVideo["height"] = Math["floor"](val * 1.35);
- this["cache"]["font"] = size_human;
- this["cache"]["fillStyle"] = "#fff";
- this["cache"]["fillText"](artistTrack, 2, val);
- if (fields["cTextOutlines"] == true) {
- this["cache"]["lineWidth"] = 2;
- this["cache"]["strokeStyle"] = "#000";
- this["cache"]["strokeText"](this_stream, 2, val);
- }
- this["massLastAmount"] = this_stream;
- }
- return popcornVideo;
- };
- users.prototype["getMaskCache"] = function(result) {
- if (this["cache"] == null || this["cache"]["canvas"] == null) {
- var popcornVideo = document["createElement"]("canvas");
- this["cache"] = popcornVideo["getContext"]("2d");
- popcornVideo["width"] = 64;
- popcornVideo["height"] = 64;
- this["cache"]["drawImage"](result ? model : lookup[this["skin"]], 0, 0, 64, 64);
- this["cache"]["globalCompositeOperation"] = "source-in";
- this["cache"]["fillStyle"] = this["color"];
- this["cache"]["rect"](0, 0, 64, 64);
- this["cache"]["fill"]();
- }
- return this["cache"]["canvas"];
- };
- users.prototype["draw"] = function(callbacks) {
- switch(this["type"]) {
- case 0:
- break;
- case 1:
- if (this["skin"] >= 0 && this["skin"] < lookup["length"]) {
- callbacks["drawImage"](this["getMaskCache"](), this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
- } else {
- if (meta["enabled"]) {
- callbacks["drawImage"](this["getMaskCache"](true), this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
- return;
- }
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], this["size"], 0, par5);
- callbacks["fillStyle"] = this["color"];
- callbacks["fill"]();
- }
- break;
- case 2:
- var options = self["playerRegistry"]["getPlayerById"](this["playerId"]);
- var minZ = extents["ALL"];
- if (self["playerId"] == this["playerId"]) {
- minZ = extents["SELF"];
- } else {
- if (self["partyIds"][this["playerId"]] != null) {
- minZ = extents["PARTY"];
- }
- }
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], this["size"], 0, par5, false);
- callbacks["globalAlpha"] = defaults["alpha"];
- callbacks["fillStyle"] = options["cellColor"];
- callbacks["closePath"]();
- callbacks["fill"]();
- if (options["skin"] != null && osFamilies["levelSkins"] >= minZ) {
- var value = options["getSkin"]();
- if (value != null && value["complete"] && value["width"] > 0) {
- callbacks["save"]();
- callbacks["clip"]();
- try {
- callbacks["drawImage"](value, this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
- } catch (e) {
- }
- callbacks["restore"]();
- }
- }
- if ((options["flags"] & 1) == 1) {
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], this["size"] + 16, 0, par5, false);
- callbacks["strokeStyle"] = "#808080";
- callbacks["lineWidth"] = 8;
- callbacks["closePath"]();
- callbacks["stroke"]();
- }
- callbacks["globalAlpha"] = 1;
- var _0x4B2F = this["y"];
- if (options["lowerName"] == true) {
- _0x4B2F = _0x4B2F + Math["floor"](this["size"] / 2);
- }
- if (options["name"]["length"] > 0 && osFamilies["levelNames"] >= minZ) {
- var result = options["getNameCache"]();
- var factor = Math["max"](.00375 * this["size"], .3);
- var width = result["width"] * factor;
- var value = result["height"] * factor;
- callbacks["drawImage"](result, this["x"] - Math["floor"](width / 2), _0x4B2F - Math["floor"](value / 2), width, value);
- }
- if (fields["cShowMass"] == true && minZ <= extents["PARTY"]) {
- var result = this["getSizeCache"]();
- factor = Math["max"](.00375 * this["size"], .3);
- width = result["width"] * factor;
- value = result["height"] * factor;
- callbacks["drawImage"](result, this["x"] - Math["floor"](width / 2), _0x4B2F + Math["floor"](value / 2), width, value);
- }
- if ((options["flags"] & 4) == 4) {
- var _0x4B89 = this["size"] + 16;
- callbacks["drawImage"](node, this["x"] - _0x4B89, this["y"] - _0x4B89, _0x4B89 * 2, _0x4B89 * 2);
- }
- break;
- case 3:
- callbacks["globalAlpha"] = defaults["alpha"];
- if (obj["complete"]) {
- callbacks["drawImage"](obj, this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
- } else {
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], this["size"], 0, 2 * Math["PI"], false);
- callbacks["fillStyle"] = this["color"];
- callbacks["fill"]();
- }
- callbacks["globalAlpha"] = 1;
- break;
- case 4:
- callbacks["globalAlpha"] = defaults["alpha"];
- if (b["complete"] && spike_mother_happy["complete"]) {
- var artistTrack = this["size"] * 2;
- if (this["size"] > 145) {
- callbacks["drawImage"](spike_mother_happy, this["x"] - this["size"], this["y"] - this["size"], artistTrack, artistTrack);
- } else {
- callbacks["drawImage"](b, this["x"] - this["size"], this["y"] - this["size"], artistTrack, artistTrack);
- }
- if (!fields["cDisableEventSkins"] && meta["mother_addon"]["enabled"] && a["complete"]) {
- 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"]);
- }
- } else {
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], this["size"], 0, par5);
- callbacks["fillStyle"] = this["color"];
- callbacks["fill"]();
- }
- callbacks["globalAlpha"] = 1;
- break;
- case 5:
- callbacks["globalAlpha"] = defaults["alpha"];
- value = workers[this["buff"]]["img"];
- if (value["complete"]) {
- callbacks["drawImage"](value, this["x"] - this["size"], this["y"] - this["size"], 178, 178);
- } else {
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], this["size"], 0, par5);
- callbacks["fillStyle"] = "#fff";
- callbacks["fill"]();
- }
- callbacks["globalAlpha"] = 1;
- break;
- }
- };
- users.prototype["drawFood"] = function(callbacks) {
- callbacks["beginPath"]();
- callbacks["arc"](this["x"], this["y"], 14, 0, par5);
- callbacks["fillStyle"] = this["color"];
- callbacks["fill"]();
- };
- Game.prototype["connectionStart"] = function () {
- var n = "Gota Web " + version;
- var buf = new ArrayBuffer(1 + n["length"] + 1 + 1);
- var arr = new DataView(buf);
- arr.setUint8(0, 255);
- arr.setUint8(1, 6);
- for(var i=0;i < n.length; i++) arr.setUint8(2 + i, n.charCodeAt(i));
- arr.setUint8(n.length + 1, 0);
- return buf;
- };
- Game.prototype["setName"] = function (selector) {
- var ab = new ArrayBuffer(1 + 1 + (selector["length"] + 1) * 2);
- var v = new DataView(ab);
- v.setUint8(0, 0);
- log(1, v, selector);
- if (fields["cSilentLogin"]) {
- v.setUint8(2 + selector["length"] * 2 + 1, 1);
- }
- return ab;
- };
- Game.prototype["sendKey"] = function (firstChild) {
- var arrayBuffer = new ArrayBuffer(1);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, firstChild);
- return arrayBuffer;
- };
- Game.prototype["sendMouse"] = function (firstChild, rightFence) {
- var arrayBuffer = new ArrayBuffer(5);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, 16);
- head.setInt16(1, firstChild, true);
- head.setInt16(3, rightFence, true);
- return arrayBuffer;
- };
- Game.prototype["sendPing"] = function () {
- var pcmEncodedBuffer16k = new ArrayBuffer(1);
- var dataView16k = new DataView(pcmEncodedBuffer16k);
- dataView16k.setUint8(0, 71);
- return pcmEncodedBuffer16k;
- };
- Game.prototype["sendSpectate"] = function (firstChild) {
- var arrayBuffer = new ArrayBuffer(1 + 2);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, 1);
- if (firstChild) {
- head["setUint16"](1, firstChild, true);
- }
- return arrayBuffer;
- };
- Game.prototype["sendChat"] = function (selector, value) {
- var ab = new ArrayBuffer(1 + 1 + (selector["length"] + 1) * 2);
- var view = new DataView(ab);
- view.setUint8(0, 72);
- view.setUint8(1, value);
- log(2, view, selector);
- return ab;
- };
- Game.prototype["sendLogin"] = function (i, n, hash) {
- var buf = new ArrayBuffer(1 + 2 + n["length"] + hash["length"]);
- var arr = new DataView(buf);
- arr.setUint8(0, i);
- for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
- arr.setUint8(n.length + 1, 0);
- cb(2 + n["length"], arr, hash);
- return buf;
- };
- Game.prototype["sendInviteResponse"] = function (old) {
- var value = new ArrayBuffer(2);
- var t = new DataView(value);
- t.setUint8(0, 41);
- t.setUint8(1, old ? 1 : 0);
- return value;
- };
- Game.prototype["sendPartyAction"] = function (firstChild, rightFence) {
- var arrayBuffer = new ArrayBuffer(6);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, 40);
- head.setUint8(1, firstChild);
- head["setUint32"](2, rightFence, true);
- return arrayBuffer;
- };
- Game.prototype["sendPartyJoin"] = function (n) {
- var buf = new ArrayBuffer(1 + n["length"] + 1);
- var arr = new DataView(buf);
- arr.setUint8(0, 42);
- for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
- arr.setUint8(n.length + 1, 0);
- return buf;
- };
- Game.prototype["sendWhisper"] = function (value, selector) {
- var ab = new ArrayBuffer(5 + (selector["length"] + 1) * 2);
- var view = new DataView(ab);
- view.setUint8(0, 73);
- view["setUint32"](1, value, true);
- log(5, view, selector);
- return ab;
- };
- Game.prototype["sendSubPanel"] = function () {
- var buf = new ArrayBuffer(1 + 6 + (result["skinName"]["length"] + 1) + (result["lockedName"]["length"] + 1));
- var arr = new DataView(buf);
- arr.setUint8(0, 10);
- arr.setUint8(1, result["nameColor"]["r"]);
- arr.setUint8(2, result["nameColor"]["g"]);
- arr.setUint8(3, result["nameColor"]["b"]);
- arr.setUint8(4, result["chatColor"]);
- arr.setUint8(5, result["effect"]);
- arr.setUint8(6, result["lowerName"] ? 1 : 0);
- cb(7, arr, result["skinName"]);
- cb(8 + result["skinName"]["length"], arr, result["lockedName"]);
- return buf;
- };
- Game.prototype["sendQueue"] = function (firstChild) {
- var arrayBuffer = new ArrayBuffer(1 + 4);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, 80);
- head.setUint8(1, firstChild);
- head.setUint8(2, 0);
- head["setUint16"](3, 0);
- return arrayBuffer;
- };
- Game.prototype["sendCustomGame"] = function (firstChild) {
- var arrayBuffer = new ArrayBuffer(1 + 1);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, 90);
- head.setUint8(1, firstChild);
- return arrayBuffer;
- };
- Game.prototype["sendLeaveMatch"] = function () {
- var pcmEncodedBuffer16k = new ArrayBuffer(1);
- var dataView16k = new DataView(pcmEncodedBuffer16k);
- dataView16k.setUint8(0, 81);
- return pcmEncodedBuffer16k;
- };
- Game.prototype["sendCaptcha"] = function (n) {
- var buf = new ArrayBuffer(1 + (n["length"] + 1));
- var arr = new DataView(buf);
- arr.setUint8(0, 100);
- for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
- arr.setUint8(n.length + 1, 0);
- return buf;
- };
- Game.prototype["sendAuthToken"] = function (n) {
- var buf = new ArrayBuffer(1 + (n["length"] + 1));
- var arr = new DataView(buf);
- arr.setUint8(0, 101);
- for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
- arr.setUint8(n.length + 1, 0);
- return buf;
- };
- Game.prototype["sendCustomGameUpdate"] = function (newBg, firstChild, rightFence) {
- var arrayBuffer = new ArrayBuffer(1 + 3);
- var head = new DataView(arrayBuffer);
- head.setUint8(0, 91);
- head.setUint8(1, newBg);
- if (newBg != style["STARTMASS"]) {
- head.setUint8(2, firstChild);
- head.setUint8(3, rightFence);
- } else {
- head["setUint16"](2, firstChild, false);
- }
- return arrayBuffer;
- };
- var x = {
- "cHideId" : function() {
- var artistTrack = fields["cHideId"] ? "none" : "block";
- $(".pID")["css"]("display", artistTrack);
- },
- "cHideServerDisplay" : function() {
- var artistTrack = fields["cHideServerDisplay"] ? "none" : "block";
- $(".psvr")["css"]("display", artistTrack);
- },
- "cTransCells" : function() {
- defaults["alpha"] = fields["cTransCells"] ? .5 : 1;
- },
- "cHideChat" : function() {
- var artistTrack = fields["cHideChat"] ? "none" : "block";
- $("#chat-panel")["css"]("display", artistTrack);
- },
- "cHideMinimap" : function() {
- var artistTrack = fields["cHideMinimap"] ? "none" : "block";
- $("#minimap-panel")["css"]("display", artistTrack);
- },
- "cShowCoordinates" : function() {
- var artistTrack = fields["cShowCoordinates"] ? "block" : "none";
- $(".coordinates")["css"]("display", artistTrack);
- makeTimeoutHandler();
- },
- "cDisableAutoZoom" : function() {
- if (fields["cDisableAutoZoom"]) {
- self["scale_base"] = .25 * Math["max"](popcornVideo["height"] / 1080, popcornVideo["width"] / 1920);
- }
- },
- "cUiEnabled" : updateSubmitButton,
- "cDisableEventSkins" : function() {
- if (meta["enabled"]) {
- $("body")["toggleClass"]("event-" + meta["key"]);
- }
- shift();
- rebuildAttributes();
- },
- "cResizableChat" : function() {
- $("#chat-resize")["css"]("display", fields["cResizableChat"] ? "block" : "none");
- },
- "sShowNames" : function() {
- osFamilies["levelNames"] = extents[fields["sShowNames"]];
- },
- "sShowSkins" : function() {
- osFamilies["levelSkins"] = extents[fields["sShowSkins"]];
- },
- "sQuality" : function() {
- scale = dest[fields["sQuality"]];
- update_measurements();
- }
- };
- var getListed = function(params) {
- var validate = this["cloneNode"]();
- validate["getContext"]("2d")["drawImage"](this, 0, 0);
- callback(params, validate, this["dataset"]["playerId"], -1);
- };
- var loadStencil = function(result) {
- var value = result["offsetY"];
- var i = Math["floor"](value / 20);
- if (value % 20 < 5) {
- return;
- }
- var object = self["party"][i];
- if (object == null) {
- return;
- }
- var l = extend(object["name"], "#fff");
- callback(result, l, object["id"], i);
- };
- const $baseDefinition = {
- MODIFIER : 1,
- PASSIVE : 2,
- CONSUMABLE : 3,
- DEBUFF : 4,
- NONE : 0
- };
- var node;
- var workers = {
- 0 : new Module("Random", "random", $baseDefinition["NONE"]),
- 1 : new Module("Maximum Cells Upgrade", "extracells", $baseDefinition["MODIFIER"]),
- 2 : new Module("Extra Consumable Slot", "extraconsumable", $baseDefinition["MODIFIER"]),
- 3 : new Module("Merge", "merge", $baseDefinition["PASSIVE"]),
- 4 : new Module("Grow", "grow", $baseDefinition["PASSIVE"]),
- 5 : new Module("Speed", "speed", $baseDefinition["PASSIVE"]),
- 6 : new Module("Guard", "guard", $baseDefinition["PASSIVE"]),
- 7 : new Module("Virus", "spike", $baseDefinition["CONSUMABLE"]),
- 8 : new Module("Disrupt", "disrupt", $baseDefinition["CONSUMABLE"]),
- 9 : new Module("Teleport", "teleport", $baseDefinition["CONSUMABLE"]),
- 10 : new Module("Disrupt", "_disrupt", $baseDefinition["DEBUFF"])
- };
- const headers = Math["PI"] * 1.5;
- var selector = [];
- var offset = 0;
- for (; offset < 180; offset++) {
- var obj = tinycolor({
- h : offset * 2,
- s : 97.25,
- v : 100
- });
- selector[offset] = obj["toHexString"]();
- }
- const f = randomMoment(selector["slice"](0));
- if (meta["enabled"] && meta["foodColors"]) {
- format = function(utc_offset) {
- return meta["foodColors"][utc_offset % meta["foodColors"]["length"]];
- };
- }
- 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"];
- const palette = ["#FFFFFF", "#FF9BDC", "#FF00FF", "#FF0000", "#C80000", "#FF6900", "#FFFF00", "#00FF00", "#008000", "#008080", "#00FFFF", "#0096FF", "#0000FF", "#CA48FA", "#8A2BE2", "#D2C878", "#8C4614"];
- const target = {
- whisper : {
- description : "Whisper a player by ID",
- triggers : ["whisper", "t", "w"],
- action : function(params) {
- var rel = parseInt(params[0]);
- if (isNaN(rel)) {
- self["selfMsg"]("Invalid player id.");
- return;
- }
- var location_feature_ids = params["slice"](1)["join"](" ");
- if (location_feature_ids["length"] != 0) {
- self["sendPacket"](new PaintTools["sendWhisper"](rel, location_feature_ids));
- }
- $get("/t " + rel + " ");
- }
- },
- reply_whisper : {
- description : "Reply to previous whisper",
- triggers : ["reply", "r"],
- action : function(options) {
- var location_feature_ids = options["join"](" ");
- if (location_feature_ids["length"] != 0) {
- self["sendPacket"](new PaintTools["sendWhisper"](0, location_feature_ids));
- }
- $get("/r ");
- }
- },
- party_chat : {
- description : "Send a message to other party members",
- triggers : ["party", "p"],
- action : function(options) {
- var _self = options["join"](" ");
- if (_self["length"] != 0) {
- self["sendPacket"](new PaintTools["sendChat"](_self, 1));
- }
- $get("/p ");
- }
- },
- invite : {
- description : "Invite a player to the party",
- triggers : ["invite", "i"],
- action : function(feature) {
- var normalized_images = parseInt(feature[0]);
- if (!isNaN(normalized_images)) {
- self["sendPacket"](new PaintTools["sendPartyAction"](0, normalized_images));
- } else {
- self["selfMsg"]("Invalid ID.");
- }
- }
- },
- leave : {
- description : "Leave your current party",
- triggers : ["leave", "l"],
- action : function($back) {
- self["sendPacket"](new PaintTools["sendPartyAction"](3, 0));
- }
- },
- promote : {
- description : "Promote a party member to leader",
- triggers : ["promote"],
- action : function(feature) {
- var normalized_images = parseInt(feature[0]);
- if (!isNaN(normalized_images)) {
- self["sendPacket"](new PaintTools["sendPartyAction"](2, normalized_images));
- } else {
- self["selfMsg"]("Invalid ID.");
- }
- }
- },
- kick : {
- description : "Kick a player from the party",
- triggers : ["kick"],
- action : function(feature) {
- var normalized_images = parseInt(feature[0]);
- if (!isNaN(normalized_images)) {
- self["sendPacket"](new PaintTools["sendPartyAction"](1, normalized_images));
- } else {
- self["selfMsg"]("Invalid ID.");
- }
- }
- },
- clear : {
- description : "Clear the chat",
- triggers : ["clear"],
- action : function($back) {
- var item = document["getElementById"]("chat-body");
- for (; item["firstChild"] != null;) {
- item["removeChild"](item["firstChild"]);
- }
- }
- },
- info : {
- description : "Get your current ID",
- triggers : ["info"],
- action : function($back) {
- if (self["playerId"] > 0) {
- self["selfMsg"]("Your id is " + self["playerId"]);
- } else {
- self["selfMsg"]("You need to be connected to a server to use this command.");
- }
- }
- },
- scrimmenu : {
- description : "Show the scrimmage menu",
- triggers : ["scrimmenu"],
- action : function($back) {
- extendedRegExp["css"]("display", extendedRegExp["css"]("display") == "none" ? "block" : "none");
- }
- },
- join : {
- description : "Join a party with a code",
- triggers : ["join", "j"],
- action : function(values) {
- var users = values[0];
- if (users != null && users["length"] != 0) {
- self["sendPacket"](new PaintTools["sendPartyJoin"](users));
- }
- }
- },
- private : {
- description : "Set the party to private",
- triggers : ["private"],
- action : function($back) {
- self["sendPacket"](new PaintTools["sendPartyAction"](4, 1));
- }
- },
- public : {
- description : "Allow players to join the party without an invite",
- triggers : ["public"],
- action : function($back) {
- self["sendPacket"](new PaintTools["sendPartyAction"](4, 0));
- }
- },
- dnsbl : {
- description : "Check if you are on a public blacklist",
- triggers : ["dnsbl"],
- action : function($back) {
- jQuery["ajax"]({
- type : "GET",
- dataType : "json",
- url : "https://gota.io/api/dnsbl",
- success : function(effects) {
- self["selfMsg"]("DNSBL: " + effects["message"]);
- },
- error : function(deleted_model) {
- self["selfMsg"]("Error while checking DNSBL");
- }
- });
- }
- },
- reset_chat : {
- description : "Reset chat size",
- triggers : ["resetchat"],
- action : function($back) {
- $("#chat-panel")["css"]("width", "360px");
- $("#chat-panel")["css"]("height", "250px");
- }
- },
- spectate : {
- description : "Spectate a player",
- triggers : ["spectate", "s"],
- action : function(feature) {
- var normalized_images = parseInt(feature[0]);
- if (!isNaN(normalized_images)) {
- self["sendPacket"](new PaintTools["sendSpectate"](normalized_images));
- } else {
- self["selfMsg"]("Invalid ID.");
- }
- }
- },
- disconnect : {
- description : "Disconnect from the server",
- triggers : ["disconnect"],
- action : function($back) {
- self["disconnect"]();
- }
- },
- account : {
- description : "Get Account UID",
- triggers : ["account"],
- action : function($back) {
- if (expected === null) {
- self["selfMsg"]("You are not logged in.");
- return;
- }
- self["selfMsg"]("UID: " + expected["uid"]);
- }
- },
- block : {
- description : "Block or unblock a player by ID",
- triggers : ["block", "b"],
- action : function(feature) {
- var level = parseInt(feature[0]);
- if (!isNaN(level)) {
- var item = getByProp(level);
- self["selfMsg"](item);
- }
- }
- }
- };
- 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",
- "MarioFP"];
- const blocks = ["Ditto", "MichaelPls", "RareParrot", "PepePls", "RooNoticeMe", "PepeEyes", "EverythingsFine", "WeSmart", "PandaAww", "SleepyCat", "Clap"];
- const byteToHex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
- 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",
- "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",
- "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",
- "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",
- "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", "",
- "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", ""];
- var lookup = ["heart", "star", "home", "apple", "spiral", "dice", "chicken", "ghost", "burger", "bow", "cloud", "skull", "mug", "flower", "music"];
- var model = null;
- const command = -32768;
- const extents = {
- ALL : 3,
- PARTY : 2,
- SELF : 1,
- NONE : 0
- };
- const dest = {
- ULTRA : 1,
- HIGH : .8,
- MEDIUM : .7,
- LOW : .6,
- VERYLOW : .5
- };
- const style = {
- MAP : 0,
- MODE : 1,
- SIZE : 2,
- STARTMASS : 3,
- LOCK : 4,
- PLAYER_UPGame : 5,
- PLAYER_UPGame_SELF : 6,
- PLAYER_LIST : 7
- };
- const generatedSeries = {
- FAILURE : 1,
- SUCCESS : 0
- };
- var moodleReleases = ["white", "#25f", "#f31", "green", "yellow", "purple", "orange"];
- var p_extl = new Promise;
- window["onCaptchaSubmit"] = function testGulpPlugin(callback) {
- self["sendPacket"](new PaintTools["sendCaptcha"](callback));
- $("#recaptcha")["css"]("display", "none");
- grecaptcha["reset"]();
- if (!self["spectate"]) {
- self["play"]();
- } else {
- self["spec"]();
- }
- };
- parseUriConfig();
- refresh();
- };
- showSideMenu = f;
- hideSideMenu = startUpload;
- func("gota.io", 1, "");
- version = "2.1.9";
- $(exports);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement