// Deobfuscation failed var touchStart = null; var touchMove = null; var mainCanvas; var rawMouseX = 0x0; var rawMouseY = 0x0; var leftPos = 0x0; var topPos = 0x0; var rightPos = 0x2710; var bottomPos = 0x2710; var txtpos_width = 0x64; var txtpos_height = 0x14; var txtpos_share = '!'; var txtpos_lastTime = 0x0; var mapx = 0x0; var mapy = 0x0; var mapDstX = 0x0; var mapDstY = 0x0; var drawMapDstPoint = false; var qPressed = false; var key1Pressed = false; var key2Pressed = false; var ctx; var moveToX = -0x1; var moveToY = -0x1; var moveToXold = -0x1; var moveToYold = -0x1; var ws = null; var ws_url = '!'; var leaderBoard = []; var lastWinner = ''; var recordHolder = ''; var userScoreCurrent = 0x0; var userScoreMax = 0x0; var gameMode = ''; var noRanking = false; var teamMapPlayers = []; var clanMapPlayers = []; var lastSendMouseMove = Date.now(); var isTyping = false; var spacePressed = false; var qPressed = false; var wPressed = false; var ePressed = false; var aPressed = false; var sPressed = false; var zPressed = false; var xPressed = false; var zoomVector = 0x0; var DIV_CHAT = ''; var loginDivName; var isGoldUsing = false; const webgl = new function () { this.canvas_gl = null; this.gl = null; this.prog_last_switch = null; this.alpha = 0x1; this.init = async function () { this.canvas_gl = document.querySelector("#canvas_gl"); this.gl = canvas_gl.getContext("webgl"); this.timeFirst = new Date().getTime(); prog_font.init("/imgs/webgl/arial-bold/"); prog_cell.init(); prog_rect.init(); prog_rectT.init(); prog_line.init(); prog_background.initProgram(); this.canvas_gl.onmousedown = mainCanvas_onmousedown; this.canvas_gl.onmousemove = mainCanvas_onmousemove; if (isTouchDevice) { this.canvas_gl.addEventListener('touchstart', onTouchStart, false); this.canvas_gl.addEventListener("touchmove", onTouchMove, false); this.canvas_gl.addEventListener("touchend", onTouchEnd, false); } this.gl.enable(this.gl.BLEND); this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA); }; this.updateTime = function (_0x238da8) { var _0x20db71 = new Date().getTime() - this.timeFirst; var _0x4c7d4c = webgl.gl.getUniformLocation(_0x238da8, 'u_time'); webgl.gl.uniform1i(_0x4c7d4c, _0x20db71); }; this.onCanvasResize = function (_0x2346db, _0x15641) { this.canvas_gl.width = _0x2346db; this.canvas_gl.height = _0x15641; }; this.draw_begin = function () { this.gl.viewport(0x0, 0x0, this.canvas_gl.width, this.canvas_gl.height); this.gl.clearColor(0x0, 0x0, 0x0, 0x0); this.gl.clear(this.gl.COLOR_BUFFER_BIT); }; this.initBuffer = function (_0xc1a910) { var _0x2701d1 = this.gl.createBuffer(); this.gl.bindBuffer(this.gl.ARRAY_BUFFER, _0x2701d1); this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array(_0xc1a910), this.gl.STATIC_DRAW); return _0x2701d1; }; this.createShader = function (_0x973411, _0x19ef4e) { var _0x101290 = this.gl.createShader(_0x973411); this.gl.shaderSource(_0x101290, _0x19ef4e); this.gl.compileShader(_0x101290); var _0x5651ea = this.gl.getShaderParameter(_0x101290, this.gl.COMPILE_STATUS); if (_0x5651ea) { return _0x101290; } console.log(this.gl.getShaderInfoLog(_0x101290)); this.gl.deleteShader(_0x101290); return null; }; this.createProgramFromShader = function (_0x5f2ea5, _0x274c2e) { var _0x26ce6c = this.gl.createProgram(); this.gl.attachShader(_0x26ce6c, _0x5f2ea5); this.gl.attachShader(_0x26ce6c, _0x274c2e); this.gl.linkProgram(_0x26ce6c); var _0x33d986 = this.gl.getProgramParameter(_0x26ce6c, this.gl.LINK_STATUS); if (_0x33d986) { return _0x26ce6c; } console.log(this.gl.getProgramInfoLog(_0x26ce6c)); this.gl.deleteProgram(_0x26ce6c); return null; }; this.createProgramFromCode = function (_0x5a5638, _0xcc44ba) { var _0x41e812 = this.createShader(this.gl.VERTEX_SHADER, _0x5a5638); var _0x5ac56b = this.createShader(this.gl.FRAGMENT_SHADER, _0xcc44ba); return this.createProgramFromShader(_0x41e812, _0x5ac56b); }; this.initAlpha = function () { if (options.get("transparentRender") == true) { this.alpha = 0.6; } else { this.alpha = 0x1; } }; }(); class textureBase { static ["textureList"] = []; constructor(_0x4e0a2f, _0x297e84) { this.imageName = _0x4e0a2f; this.directory = _0x297e84; this.image = new Image(); this.image.src = _0x297e84 + this.imageName; this.gltexture = webgl.gl.createTexture(); this.isLoaded = false; this.image.onload = function () { webgl.gl.bindTexture(webgl.gl.TEXTURE_2D, this.gltexture); webgl.gl.texImage2D(webgl.gl.TEXTURE_2D, 0x0, webgl.gl.RGBA, webgl.gl.RGBA, webgl.gl.UNSIGNED_BYTE, this.image); webgl.gl.texParameteri(webgl.gl.TEXTURE_2D, webgl.gl.TEXTURE_MIN_FILTER, webgl.gl.NEAREST); webgl.gl.texParameteri(webgl.gl.TEXTURE_2D, webgl.gl.TEXTURE_MAG_FILTER, webgl.gl.NEAREST); webgl.gl.generateMipmap(webgl.gl.TEXTURE_2D); this.isLoaded = true; }.bind(this); textureSkin.textureList[_0x4e0a2f] = this; } ["bind"]() { webgl.gl.bindTexture(webgl.gl.TEXTURE_2D, this.gltexture); } static ["load"](_0x1f8ea4) { new textureSkin(_0x1f8ea4); } static ["bind"](_0x393f7b) { let _0x7d5657 = textureSkin.get(_0x393f7b); _0x7d5657.bind(); } static ["get"](_0xb547e2) { return textureSkin.textureList[_0xb547e2] === undefined ? null : textureSkin.textureList[_0xb547e2]; } static ["isReady"](_0x6cb460) { let _0x46ebcc = textureSkin.get(_0x6cb460); return _0x46ebcc == null ? false : _0x46ebcc.isLoaded; } } class textureButton extends textureBase { constructor(_0x5885f3) { super(_0x5885f3, "/imgs/"); } } class textureSkin extends textureBase { constructor(_0x1f1a6b) { super(_0x1f1a6b, "/cdn2/"); } } class screenButton { constructor(_0x8e7921, _0x180610, _0x52f843, _0x1a33b3, _0x1bc1a5) { this.x = _0x8e7921; this.y = _0x180610; this.w = _0x52f843; this.h = _0x1a33b3; this.bottomToTop = 0x0; this.rightToLeft = 0x0; this.wfull = 0x0; this.src = null; this.img = null; this.name = _0x1bc1a5; this.buttonDownInvited = false; this.onButtonDown = null; this.onButtonUp = null; this.isButtonDownActivated = false; this.visible = true; this.texture = null; return this; } ["setVisible"](_0x187159) { this.visible = _0x187159; } ['setBottomToTop']() { this.bottomToTop = 0x1; } ['setRightToLeft']() { this.rightToLeft = 0x1; } ["setWidthFull"]() { this.wfull = 0x1; } ["setPosition"](_0xfc8ed4, _0x14a554) { this.x = _0xfc8ed4; this.y = _0x14a554; } ['setSize'](_0x29f687, _0x2cf86c) { this.w = _0x29f687; this.h = _0x2cf86c; } ['isInside'](_0x879cb3, _0x5d8076) { if (this.visible == false) { return false; } var _0x1c5d81 = this.getBoundry(); var _0x31b8b1 = _0x879cb3 - _0x1c5d81.x; var _0x7b58a9 = _0x5d8076 - _0x1c5d81.y; return !!(_0x31b8b1 >= 0x0 && _0x31b8b1 <= _0x1c5d81.w && _0x7b58a9 >= 0x0 && _0x7b58a9 <= _0x1c5d81.h); } ["buttonDownEvent"](_0x4e6b3c, _0x2f0de2) { this.isButtonDownActivated = true; if (this.onButtonDown != null) { this.onButtonDown(); } } ["buttonUpEvent"](_0x53c910, _0x349672) { this.isButtonDownActivated = false; if (this.onButtonUp != null) { this.onButtonUp(); } } ["getBoundry"]() { var _0x2244c3; if (this.bottomToTop == 0x1) { _0x2244c3 = mainCanvas.height - this.y; } else { _0x2244c3 = this.y; } var _0x3df531; if (this.rightToLeft == 0x1) { _0x3df531 = mainCanvas.width - this.x; } else { _0x3df531 = this.x; } var _0x572df3; if (this.wfull == 0x1) { _0x3df531 = 0x0; _0x572df3 = mainCanvas.width; } else { _0x572df3 = this.w; } return { 'x': _0x3df531, 'y': _0x2244c3, 'w': _0x572df3, 'h': this.h }; } ["drawGeneric"]() { var _0x4bec2a = this.getBoundry(); ctx.globalAlpha = 0.9; ctx.fillStyle = '#F1C40F'; ctx.fillRect(_0x4bec2a.x, _0x4bec2a.y, _0x4bec2a.w, _0x4bec2a.h); ctx.globalAlpha = 0x1; ctx.fillStyle = '#FFF'; ctx.font = "18px Arial"; var _0x54f6d4 = ctx.measureText(this.name).width; var _0x169691 = (_0x4bec2a.w - _0x54f6d4) / 0x2; var _0x2c0d55 = (_0x4bec2a.h - 0x12) / 0x2 - 0x2; ctx.fillText(this.name, _0x4bec2a.x + _0x169691, _0x4bec2a.y + 0x12 + _0x2c0d55); } ['loadImage'](_0x165168) { this.img = new Image(); this.img.src = "/imgs/" + _0x165168; this.src = _0x165168; this.texture = new textureButton(_0x165168); } ['drawImage']() { var _0x277cd7 = this.getBoundry(); ctx.globalAlpha = 0x1; ctx.fillStyle = '#FFFFFF'; ctx.drawImage(this.img, _0x277cd7.x, _0x277cd7.y, _0x277cd7.w, _0x277cd7.h); } ["draw"]() { if (this.visible == false) { return; } switch (renderMode) { case 0x1: if (this.img != null) { this.drawImage(); } else { this.drawGeneric(); } break; case 0x2: if (textureButton.isReady(this.src)) { textureButton.bind(this.src); prog_rectT.draw(this.x, this.y, this.w, this.h, this.bottomToTop, this.rightToLeft); } break; } } } var sb; function buttonsInit() { var _0x223e70 = { "mainMenu": new screenButton(0x5, 0xd2, 0x30, 0x30, "MENU") }; _0x223e70.mainMenu.loadImage("main-menu.png"); _0x223e70.mainMenu.onButtonDown = function () { closeFullscreen(); $("#overlays").fadeIn("slow"); }; _0x223e70.useGold = new screenButton(0x0, 0x168, 0x30, 0x30, "-10"); _0x223e70.useGold.loadImage('coin.png'); _0x223e70.useGold.onButtonDown = function () { if (options.get("macro")) { sendUint8(0x23); isGoldUsing = true; } else { sendUint8(0x4); } }; _0x223e70.useGold.onButtonUp = function () { if (options.get("macro")) { sendUint8(0x25); isGoldUsing = false; } }; _0x223e70.useGoldBig = new screenButton(0x50, 0x168, 0x30, 0x30, "-100"); _0x223e70.useGoldBig.loadImage("coins.png"); _0x223e70.useGoldBig.onButtonDown = function () { if (options.get("macro")) { sendUint8(0x23); sendUint8(0x24); isGoldUsing = true; } else { sendUint8(0x18); } }; _0x223e70.useGoldBig.onButtonUp = function () { if (options.get("macro")) { sendUint8(0x25); sendUint8(0x26); isGoldUsing = false; } }; _0x223e70.feed = new screenButton(0x0, 0x1c2, 0x30, 0x30, 'ooo'); _0x223e70.feed.loadImage('more.png'); _0x223e70.feed.onButtonDown = function () { sendUint8(0x16); }; _0x223e70.feed.onButtonUp = function () { sendUint8(0x17); }; _0x223e70.split = new screenButton(0x0, 0x1f4, 0x30, 0x30, "O|O"); _0x223e70.split.loadImage("cell-division.png"); _0x223e70.split.onButtonDown = function () { sendUint8(0x11); }; _0x223e70.zoomIn = new screenButton(0x28, 0x1f4, 0x30, 0x30, "(+)"); _0x223e70.zoomIn.loadImage("zoom-in2.png"); _0x223e70.zoomIn.onButtonDown = function () { zoomVector = 0x1; }; _0x223e70.zoomIn.onButtonUp = function () { zoomVector = 0x0; }; _0x223e70.zoomOut = new screenButton(0x50, 0x1f4, 0x30, 0x30, '(-)'); _0x223e70.zoomOut.loadImage("zoom-out.png"); _0x223e70.zoomOut.onButtonDown = function () { zoomVector = -0x1; }; _0x223e70.zoomOut.onButtonUp = function () { zoomVector = 0x0; }; _0x223e70.chatShow = new screenButton(0x30, 0x30, 0x30, 0x30, "chat.."); _0x223e70.chatShow.loadImage("chat_b_32.png"); _0x223e70.chatShow.setBottomToTop(); _0x223e70.chatShow.setRightToLeft(); _0x223e70.chatShow.isShow = false; _0x223e70.chatShow.setShow = function (_0x34d9b9) { this.isShow = _0x34d9b9; if (this.isShow) { $(DIV_CHAT).show(); } else { $(DIV_CHAT).hide(); } for (b in _0x223e70) { _0x223e70[b].setVisible(!this.isShow); } }; _0x223e70.chatShow.onButtonDown = function () { this.setShow(true); }.bind(_0x223e70.chatShow); return _0x223e70; } function sendChat2(_0x2b2aa2) { if (_0x2b2aa2.substring(0x0, 0x3) == "-g ") { let _0x3ae087 = _0x2b2aa2.substring(0x3); let _0x579403 = Array.from(document.querySelectorAll("#gamemode option")); let _0x2a4c0e = _0x579403.find(_0x2ae4a7 => _0x2ae4a7.textContent === _0x3ae087.toUpperCase()); if (_0x2a4c0e != null) { _0x2a4c0e.selected = true; setserver4(_0x2a4c0e.value); } } else { if (_0x2b2aa2.substring(0x0, 0x4) == "-go ") { let _0x6ae6a5 = _0x2b2aa2.substring(0x4); let _0x1ae407 = Array.from(document.querySelectorAll("#gamemode option")); let _0x4d9b12 = _0x1ae407.find(_0x486aa0 => _0x486aa0.textContent === _0x6ae6a5.toUpperCase()); if (_0x4d9b12 != null) { _0x4d9b12.selected = true; skipPopupOnClose = true; reconnect = 0x1; cellManager.drawMode = 0x0; cellManager.clearRecord(); userScoreCurrent = 0x0; userScoreMax = 0x0; playMode = 0x1; setserver4(_0x4d9b12.value); } } else { if (_0x2b2aa2.substring(0x0, 0x4) == "-gi ") { let _0x2e8e4f = _0x2b2aa2.substring(0x4); let _0x5bbb1a = Array.from(document.querySelectorAll("#gamemode option")); let _0xc7caa1 = _0x5bbb1a.find(_0x4ce6d7 => _0x4ce6d7.textContent === _0x2e8e4f.toUpperCase()); if (_0xc7caa1 != null) { _0xc7caa1.selected = true; skipPopupOnClose = true; reconnect = 0x1; cellManager.drawMode = 0x0; cellManager.clearRecord(); playMode = 0x2; setserver4(_0xc7caa1.value); } } else { if (_0x2b2aa2 == '-odulekle100k') { let _0x32aef2 = confirm("100K Ödül Eklensinmi(Bonus Goldunuzdan Düşer)"); if (_0x32aef2) { odulEkle_100k(); } } else { if (_0x2b2aa2 == '-b') { sendUint8(0x41); } else { if (_0x2b2aa2 == "-bg") { sendUint8(0x43); } else { if (_0x2b2aa2.substring(0x0, 0x4) == "-bt ") { let _0x260a81 = _0x2b2aa2.substring(0x4); var _0x19099c = prepareData(0x5); _0x19099c.setUint8(0x0, 0x42); _0x19099c.setUint32(0x1, _0x260a81, true); wsSend(_0x19099c); } else { if (_0x2b2aa2.length > 0x0) { var _0x46165e = true; if (Number(localStorage.chatMode) == 0x3) { _0x46165e = confirm(_0x2b2aa2 + "\n" + trans[0x12b] + "\n" + trans[0x79]); } if (_0x46165e) { sendChat(_0x2b2aa2); } } } } } } } } } } window.sendChat2 = sendChat2; function sendChatMessage() { var _0x1ece6b = ''; if (isMobile) { _0x1ece6b = "chat_textbox_mobile"; } else { _0x1ece6b = 'chat_textbox'; } var _0x2e2f02 = document.getElementById(_0x1ece6b); _0x2e2f02.blur(); chattxt = _0x2e2f02.value; sendChat2(chattxt); _0x2e2f02.value = ''; } function onTouchStart(_0x2f75df) { _0x2f75df.preventDefault(); var _0x4d234a = 0x0; for (var _0x2e1bc5 of _0x2f75df.changedTouches) { var _0x131ba2 = { 'x': Math.floor(_0x2e1bc5.clientX), 'y': Math.floor(_0x2e1bc5.clientY) }; for (var _0x222f90 in sb) { if (sb[_0x222f90].isInside(_0x131ba2.x, _0x131ba2.y)) { sb[_0x222f90].buttonDownEvent(_0x131ba2.x, _0x131ba2.y); _0x4d234a = 0x1; } } if (typeof isAdmin !== "undefined" && spawnOnClick) { spawnOnClick = false; gamexy = cameraManager.convertPixelToGame(_0x131ba2.x, _0x131ba2.y); sendSpawnPlayerAdmin(gamexy.x, gamexy.y); } tryClickChatName(_0x131ba2.x, _0x131ba2.y); tryClickChangeSpectator(_0x131ba2.x, _0x131ba2.y); } if (_0x4d234a == 0x1) { return; } if (_0x2f75df.changedTouches.length == 0x1) { touchStart = _0x2f75df.changedTouches[0x0]; } } function onTouchMove(_0x1dc59c) { _0x1dc59c.preventDefault(); touchMove = null; if (touchStart != null) { for (var _0x35b98c of _0x1dc59c.touches) { if (_0x35b98c.identifier == touchStart.identifier) { touchMove = _0x35b98c; break; } } } if (touchMove != null) { dx = touchMove.clientX - touchStart.clientX; dy = touchMove.clientY - touchStart.clientY; rawMouseX = mainCanvas.width / 0x2 + dx * 0x3; rawMouseY = mainCanvas.height / 0x2 + dy * 0x3; } sendMouseMove(); } function onTouchEnd(_0x406ec7) { _0x406ec7.preventDefault(); for (var _0x1fd08 of _0x406ec7.changedTouches) { if (touchStart != null && _0x1fd08.identifier == touchStart.identifier) { touchStart = null; touchMove = null; } } for (var _0x1fd08 of _0x406ec7.changedTouches) { var _0x18ed99 = { 'x': Math.floor(_0x1fd08.clientX), 'y': Math.floor(_0x1fd08.clientY) }; for (var _0x4a601e in sb) { if (sb[_0x4a601e].isButtonDownActivated) { sb[_0x4a601e].buttonUpEvent(_0x18ed99.x, _0x18ed99.y); } } } } var topMessage1 = ''; var topMessage2 = ''; var topMessage3 = ''; var winPrize = 0x0; var enterPrice = 0x0; var serverVersion = 0x0; var playerMaxMass = 0x0; var playerMaxCells = 0x0; var virusMinAmount = 0x0; var virusMaxAmount = 0x0; var virusCount = 0x0; var playerCount = 0x0; var observerCount = 0x0; var reconnect = 0x0; var premiumPlayerCount = 0x0; var premiumPlayerMinForBoost = 0x0; var changeSkinCounter = 0x0; var leaderboard_ext = []; var timestamp = 0x0; var isTouchDevice = ('ontouchstart' in document.documentElement); var mouseDetected = false; var renderMode = 0x2; var leaderboardIndex = 0x0; var ColorManager = { 'Dark': { 'Gold': "#FFFF00", 'Prize': "#FFF000", 'GoldToPrize': "#FFF000", 'AutoBig': "#FFF000", 'TopMessage': '#00FF00', 'ChatT': "#CCCC00", 'ChatC': "#00CCCC", 'ChatA': "#18D8EB", 'ChatElse': "#FFFFFF", 'Leaderboard_Background': '#000000', 'Leaderboard_LastWinner': "#FFFF00", 'Name_Default': "#FFFFFF", 'Name_SameTeamOnList': "#DDDD00", 'Name_SameTeamOnMap': "#DDDD00", 'Name_SameClanOnList': "#00FF00", 'Name_SameClanOnMap': "#0000FF", 'Admin_MenuIcon': "#FF0000", 'RoomInfo': "#FFFFFF", 'Clear': '#111111', 'TimerAndRecord_BG': "#DDDDDD", 'TimerAndRecord_Timer': "#0000FF", 'TimerAndRecord_Record': "#FFFF00", 'Score': "#FFFFFF", 'Map_BG': "#DDDDDD", 'Map_Dst': "#FF0000", 'Map_Me': "#FFFFFF", 'Position': "#AAAAAA", 'Chat_Default': "#FF0000", 'Border': "#FF0000", 'Grid': '#AAAAAA', 'EnterPrice': '#FF0000', 'UserID': "#FFFFFF", 'LockMouse': "#FFFFFF", 'Leaderboard_Spectator': '#FF0000', 'Leaderboard_Player': "#FFAAAA", 'Leaderboard_Default': "#FFFFFF", 'Chat_AccNo': "#DDDDDD", 'LastSeconds': "#FF0000", 'AdminInfo': "#FF0000", 'MovePoint': "#FFFFFF", 'Chat_Guest': "#FFFFFF", 'Virus_Line': "#00DD00", 'RedVirus_Line': "#DD0000", 'TouchMark': "#5596FF", 'CellBorder': "#FFFFFF", 'Chat_BG': "#000000" }, 'Light': { 'Gold': "#AAAA00", 'Prize': '#FFF000', 'GoldToPrize': "#AAA000", 'AutoBig': "#FFF000", 'TopMessage': "#009900", 'ChatT': "#CCCC00", 'ChatC': "#0000CC", 'ChatA': "#18D8EB", 'ChatElse': "#FFFFFF", 'Leaderboard_Background': "#000000", 'Leaderboard_LastWinner': '#FFFF00', 'Name_Default': '#FFFFFF', 'Name_SameTeamOnList': "#DDDD00", 'Name_SameTeamOnMap': "#DDDD00", 'Name_SameClanOnList': '#00FF00', 'Name_SameClanOnMap': "#0000FF", 'Admin_MenuIcon': "#FF0000", 'RoomInfo': "#000000", 'Clear': '#F2FBFF', 'TimerAndRecord_BG': "#000000", 'TimerAndRecord_Timer': "#0000FF", 'TimerAndRecord_Record': "#FFFF00", 'Score': '#000000', 'Map_BG': "#000000", 'Map_Dst': "#990000", 'Map_Me': '#FFFFFF', 'Position': "#AAAAAA", 'Chat_Default': '#FF0000', 'Border': "#FF0000", 'Grid': "#000000", 'EnterPrice': "#FF0000", 'UserID': "#000000", 'LockMouse': "#000000", 'Leaderboard_Spectator': "#FF0000", 'Leaderboard_Player': "#FFAAAA", 'Leaderboard_Default': '#FFFFFF', 'Chat_AccNo': "#DDDDDD", 'LastSeconds': '#FF0000', 'AdminInfo': '#FF0000', 'MovePoint': "#FFFFFF", 'Chat_Guest': "#FFFFFF", 'Virus_Line': "#00DD00", 'RedVirus_Line': "#DD0000", 'TouchMark': "#5596FF", 'CellBorder': "#000000", 'Chat_BG': "#000000" }, 'Current': {}, 'Current_RGB': {}, 'Current_RGB_GL': {}, 'hexToRgb': function (_0x34ef71) { var _0x4522a7 = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(_0x34ef71); return _0x4522a7 ? { 'r': parseInt(_0x4522a7[0x1], 0x10), 'g': parseInt(_0x4522a7[0x2], 0x10), 'b': parseInt(_0x4522a7[0x3], 0x10), 'toGL': function () { return [this.r / 0xff, this.g / 0xff, this.b / 0xff]; } } : null; }, 'UpdateCurrent': function () { if (options.get("showDarkTheme")) { this.Current = this.Dark; } else { this.Current = this.Light; } for (let _0xb1e3a in this.Current) { this.Current_RGB[_0xb1e3a] = this.hexToRgb(this.Current[_0xb1e3a]); this.Current_RGB_GL[_0xb1e3a] = this.Current_RGB[_0xb1e3a].toGL(); } } }; class textMover { constructor(_0x3453e, _0x184bbe, _0x1d18a7, _0x374962, _0x24bf7b, _0x3e4308, _0x263f27, _0x566e06) { this.txt = _0x3453e; this.xs = _0x184bbe; this.ys = _0x1d18a7; this.x = _0x184bbe; this.y = _0x1d18a7; this.vx = _0x374962; this.vy = _0x24bf7b; this.timeOfLife = _0x3e4308; this.color = _0x263f27; this.color_gl = _0x566e06; this.birthdate = new Date().getTime(); textMoverList.push(this); } ["getAge"]() { return new Date().getTime() - this.birthdate; } ["update"]() { if (this.getAge() >= this.timeOfLife) { var _0x18a70f = textMoverList.indexOf(this); textMoverList.splice(_0x18a70f, 0x1); } } ['draw']() { var _0x3bf0a4 = this.getAge(); var _0x2ab5f7 = _0x3bf0a4 / 0x3e8; var _0x5b621d = _0x3bf0a4 / this.timeOfLife; var _0x1ae4a8 = (0x1 - _0x5b621d) / 1.5; var _0x2047ed = 0x1e - Math.round(_0x5b621d * 0x14); this.x = this.xs + this.vx * _0x2ab5f7; this.y = this.ys + this.vy * _0x2ab5f7; if (_0x3bf0a4 < this.timeOfLife) { switch (renderMode) { case 0x1: ctx.globalAlpha = _0x1ae4a8; ctx.font = _0x2047ed + "px Ubuntu"; ctx.fillStyle = this.color; ctx.fillText(this.txt, this.x, this.y); break; case 0x2: prog_font.drawUI(this.x, this.y, this.color_gl, _0x1ae4a8, _0x2047ed, this.txt); break; } } } } var textMoverList = []; function secToTime(_0x5752ae) { var _0x26f974 = Math.floor(_0x5752ae / 0x3c); var _0x4bab96 = _0x5752ae % 0x3c; var _0x3caea2 = ''; if (_0x26f974 < 0xa) { _0x3caea2 += '0'; } _0x3caea2 += _0x26f974 + ':'; if (_0x4bab96 < 0xa) { _0x3caea2 += '0'; } _0x3caea2 += _0x4bab96; return _0x3caea2; } var adminChatMenu2 = { 'html_container': null, 'html_title': null, 'html_sil': null, 'html_silHepsi': null, 'html_kick': null, 'html_ipBan': null, 'html_sohbetKapatBtn': null, 'html_sohbetKapatTxt': null, 'html_sohbetAc': null, 'html_kapat': null, 'chat_id': null, 'userId': 0x0, 'pid': 0x0, 'sil': function (_0x8a6ff6) { var _0x7af6ac = prepareData(0x5); _0x7af6ac.setUint8(0x0, 0x31); _0x7af6ac.setUint32(0x1, _0x8a6ff6); wsSend(_0x7af6ac); }, 'init': function () { this.html_container = document.createElement("DIV"); this.html_container.style.transform = "translate(-50%, -50%)"; this.html_container.style.position = "absolute"; this.html_container.style.left = "50%"; this.html_container.style.top = "50%"; this.html_container.style.color = "#000"; this.html_container.style.backgroundColor = '#00F'; this.html_container.style.display = "none"; this.html_container.style.padding = '10px'; this.html_container.style.fontSize = "20px"; this.html_sil = document.createElement("INPUT"); this.html_sil.type = "button"; this.html_sil.value = "Bu Mesajı Sil"; this.html_sil.onclick = function () { this.sil(this.chat_id); }.bind(this); this.html_silHepsi = document.createElement('INPUT'); this.html_silHepsi.type = "button"; this.html_silHepsi.value = "Oyuncunun Bütün Mesajlarını Sil"; this.html_silHepsi.onclick = function () { var _0x5ed4b7 = 0x0; for (var _0x282102 of chatManager.chatList) { if (_0x282102.userId == this.userId) { setTimeout(this.sil.bind(this, _0x282102.chat_id), 0x64 * _0x5ed4b7); _0x5ed4b7++; } } }.bind(this); this.html_kick = document.createElement('INPUT'); this.html_kick.type = "button"; this.html_kick.value = "Odadan At(kick)"; this.html_kick.onclick = function () { console.log("kick " + this.pid); kick_pid(this.pid); }.bind(this); this.html_ipBan = document.createElement('INPUT'); this.html_ipBan.type = "button"; this.html_ipBan.value = "Odadan At(ipBan)"; this.html_ipBan.onclick = function () { console.log("ipBan " + this.pid); ipBan_pid(this.pid); }.bind(this); this.html_sohbetKapatBtn = document.createElement("INPUT"); this.html_sohbetKapatBtn.type = "button"; this.html_sohbetKapatBtn.value = "Sohbet Kapat"; this.html_sohbetKapatBtn.onclick = function () { var _0x31cbeb = this.html_sohbetKapatTxt.value; if (isNumber(_0x31cbeb)) { sohbetKapat(this.userId, _0x31cbeb); } }.bind(this); this.html_sohbetKapatTxt = document.createElement("INPUT"); this.html_sohbetKapatTxt.type = "text"; this.html_sohbetKapatTxt.value = '3'; this.html_sohbetKapatTxt.size = '2'; this.html_sohbetKapatTxt.maxLength = '2'; this.html_sohbetAc = document.createElement('INPUT'); this.html_sohbetAc.type = "button"; this.html_sohbetAc.value = "Sohbet Aç"; this.html_sohbetAc.onclick = function () { sohbetAc(this.userId); }.bind(this); this.html_kapat = document.createElement("INPUT"); this.html_kapat.type = 'button'; this.html_kapat.value = "Kapat"; this.html_kapat.onclick = function () { this.hide(); }.bind(this); this.html_title = document.createElement("DIV"); this.html_title.style.color = "#FFF"; this.html_container.appendChild(this.html_title); this.html_container.appendChild(document.createElement('BR')); this.html_container.appendChild(this.html_sil); this.html_container.appendChild(document.createElement('BR')); this.html_container.appendChild(this.html_silHepsi); this.html_container.appendChild(document.createElement('BR')); if (ipdiscord_isAdmin == 0x1) { this.html_container.appendChild(this.html_kick); this.html_container.appendChild(document.createElement('BR')); this.html_container.appendChild(this.html_ipBan); this.html_container.appendChild(document.createElement('BR')); } this.html_container.appendChild(this.html_sohbetKapatBtn); this.html_container.appendChild(this.html_sohbetKapatTxt); if (ipdiscord_isAdmin == 0x1) { this.html_container.appendChild(document.createElement('BR')); this.html_container.appendChild(this.html_sohbetAc); } this.html_container.appendChild(document.createElement('BR')); this.html_container.appendChild(document.createElement('BR')); this.html_container.appendChild(this.html_kapat); document.body.appendChild(this.html_container); }, 'show': function (_0x2efd3f, _0x3ec520, _0x32d289, _0x55bb61) { this.ip = ''; this.html_kick.style.display = 'none'; this.html_ipBan.style.display = "none"; playerInfoList.forEach(function (_0x40e778, _0x299146) { if (_0x40e778.userId == _0x55bb61) { console.log(_0x40e778); this.pid = _0x40e778.pID; this.html_kick.style.display = 'inline-block'; this.html_ipBan.style.display = "inline-block"; } }.bind(this)); this.userId = _0x55bb61; this.chat_id = _0x32d289; this.html_title.innerHTML = "Hesap No:" + this.userId + '
İsim:' + _0x2efd3f + '
Mesaj:' + _0x3ec520; this.html_container.style.display = "block"; }, 'hide': function () { this.html_container.style.display = "none"; } }; var microphone = { 'mediaRecorder': null, 'playList': [], 'soundContainer': null, 'soundCheckBox': null, 'teamR': null, 'clanR': null, 'UI_talk': null, 'initRecord': function () { navigator.mediaDevices.getUserMedia({ 'audio': true }).then(_0x453e72 => { this.mediaRecorder = new MediaRecorder(_0x453e72); this.mediaRecorder.addEventListener("dataavailable", _0x397d6c => { new Response(_0x397d6c.data).arrayBuffer().then(_0xb0f85a => { var _0xa504e3 = 0x0; if (this.clanR.checked) { _0xa504e3 = 0x1; } var _0x15e8a0 = new Uint8Array(_0xb0f85a); var _0x203b29 = new Uint8Array(_0xb0f85a.byteLength + 0x2); _0x203b29.set(_0x15e8a0, 0x2); var _0x50a58a = new DataView(_0x203b29.buffer); _0x50a58a.setUint8(0x0, 0x34); _0x50a58a.setUint8(0x1, _0xa504e3); wsSend(_0x50a58a); }); }); }); }, 'chopper': function () { if (this.mediaRecorder != null && this.mediaRecorder.state == "recording") { this.mediaRecorder.stop(); this.mediaRecorder.start(); } }, 'initChopper': function () { setInterval(this.chopper.bind(this), 0x3e8); }, 'startRecord': function () { if (this.mediaRecorder != null && this.mediaRecorder.state == "inactive") { this.mediaRecorder.start(); } }, 'stopRecord': function () { if (this.mediaRecorder != null && this.mediaRecorder.state == 'recording') { this.mediaRecorder.stop(); } }, 'drawPlayList': function () { if (this.soundContainer == null) { return; } var _0x381357 = this.soundContainer.getBoundingClientRect(); var _0x447a35 = _0x381357.left; var _0x12e91c = _0x381357.top - 0xa; switch (renderMode) { case 0x1: ctx.fillStyle = "#FFFF00"; ctx.font = "20px Ubuntu"; var _0x4fed58 = 0x0; for (var _0x56dfbd = 0x0; _0x56dfbd < this.playList.length; _0x56dfbd++) { var _0x5e3b61 = this.playList[_0x56dfbd]; if (_0x5e3b61.live == true) { ctx.fillText(_0x5e3b61.userId + " " + _0x5e3b61.userName, _0x447a35, _0x12e91c - _0x4fed58 * 0x14); _0x4fed58++; } else { this.playList.splice(_0x56dfbd, 0x1); } } break; case 0x2: var _0x4fed58 = 0x0; for (var _0x56dfbd = 0x0; _0x56dfbd < this.playList.length; _0x56dfbd++) { var _0x5e3b61 = this.playList[_0x56dfbd]; if (_0x5e3b61.live == true) { prog_font.drawUI(_0x447a35, _0x12e91c - _0x4fed58 * 0x14, [0x1, 0x1, 0x0], 0x1, 0x14, _0x5e3b61.userId + " " + _0x5e3b61.userName); _0x4fed58++; } else { this.playList.splice(_0x56dfbd, 0x1); } } break; } }, 'sendSoundOnOff': function (_0x496491) { var _0x1748ec = prepareData(0x2); _0x1748ec.setUint8(0x0, 0x35); _0x1748ec.setUint8(0x1, _0x496491); wsSend(_0x1748ec); }, 'sendSoundOnOff_fromUI': function () { var _0x2d6e7b; if (this.soundCheckBox.checked == true) { _0x2d6e7b = 0x1; } else { _0x2d6e7b = 0x1; } this.sendSoundOnOff(_0x2d6e7b); }, 'initHtml': function () { this.soundContainer = document.getElementById("soundContainer"); if (this.soundContainer == null) { console.log("soundContainer elementi mevcut değil."); return; } var _0x2cac31 = document.createElement('INPUT'); _0x2cac31.type = "button"; _0x2cac31.value = trans[0x138]; _0x2cac31.onclick = function () { this.initRecord(); this.soundContainer.removeChild(_0x2cac31); this.soundContainer.appendChild(this.UI_talk); this.soundContainer.appendChild(_0xbac26f); this.soundContainer.appendChild(_0x43ae74); }.bind(this); this.soundCheckBox = document.createElement("INPUT"); this.soundCheckBox.type = "checkbox"; this.soundCheckBox.value = "sound"; this.soundCheckBox.checked = true; this.soundCheckBox.onclick = function () { var _0xb67221; if (this.checked == true) { _0xb67221 = 0x1; } else { _0xb67221 = 0x1; } sendSoundOnOff(_0xb67221); }; var _0x5ae54e = document.createElement("LABEL"); _0x5ae54e.appendChild(this.soundCheckBox); var _0x11d204 = document.createTextNode(trans[0x136]); _0x5ae54e.appendChild(_0x11d204); this.teamR = document.createElement('INPUT'); this.teamR.type = 'radio'; this.teamR.value = "team"; this.teamR.checked = true; this.teamR.onclick = function (_0x1d7f52) { this.clanR.checked = false; }.bind(this); var _0xbac26f = document.createElement("LABEL"); _0xbac26f.appendChild(this.teamR); _0xbac26f.appendChild(document.createTextNode("Takım")); this.clanR = document.createElement("INPUT"); this.clanR.type = 'radio'; this.clanR.value = "clan"; this.clanR.onclick = function (_0x25a399) { this.teamR.checked = false; }.bind(this); var _0x43ae74 = document.createElement("LABEL"); _0x43ae74.appendChild(this.clanR); _0x43ae74.appendChild(document.createTextNode("Klan")); this.UI_talk = document.createElement("INPUT"); this.UI_talk.type = "button"; this.UI_talk.value = "F " + trans[0x137]; this.UI_talk.className = "talkButton"; this.UI_talk.onmousedown = function () { this.startRecord(0x3e8); }.bind(this); this.UI_talk.onmouseup = function () { this.stopRecord(); }.bind(this); this.soundContainer.appendChild(_0x5ae54e); this.soundContainer.appendChild(_0x2cac31); }, 's2c_voice': function (_0x3390fe, _0x54fdf0, _0x54191b) { if (this.soundCheckBox.checked === false) { return; } if (_0x54191b.byteLength == 0x0) { return; } let _0x2db056 = new Blob([_0x54191b]); let _0x371d30 = window.URL.createObjectURL(_0x2db056); var _0x4af4c9 = new Audio(_0x371d30); var _0x3c8310 = { 'userId': _0x3390fe, 'userName': _0x54fdf0, 'live': true, 'data': _0x4af4c9 }; this.playList.push(_0x3c8310); _0x4af4c9.onended = function (_0xd4d89d) { this.live = false; }.bind(_0x3c8310); _0x4af4c9.play(); } }; microphone.initChopper(); function getLeaderboardExt(_0xf0365c) { for (var _0x3004d5 = 0x0; _0x3004d5 < leaderboard_ext.length; _0x3004d5++) { if (leaderboard_ext[_0x3004d5].pID == _0xf0365c) { return leaderboard_ext[_0x3004d5]; } } return null; } function drawLeaderboard() { var _0x1525be = leaderBoard; if (cellManager.drawMode == 0x1 || cellManager.drawMode == 0x2) { var _0x5c6243 = cellManager.getReplayItem(); if (_0x5c6243 != null) { _0x1525be = _0x5c6243.leaderBoard; } } var _0x480a1a; if (isMobile) { _0x480a1a = 0xc; } else { _0x480a1a = 0x10; } var _0xa4e3df; if (isMobile) { _0xa4e3df = _0x1525be.length < 0x5 ? _0x1525be.length : 0x5; } else { _0xa4e3df = _0x1525be.length; } var _0x480b7b = _0x480a1a * 0xd; var _0x24ddab = _0x480b7b * 0.5; var _0x2dab2b = _0x480a1a * 0x4 + _0x480a1a * 1.2 * _0xa4e3df; var _0x30810d = mainCanvas.width - _0x480b7b; var _0x3945e5; if (isMobile) { if (mainCanvas.width > mainCanvas.height) { _0x3945e5 = 0x0; } else { _0x3945e5 = 0x96; } } else { _0x3945e5 = 0x0; } switch (renderMode) { case 0x1: var _0x44bdd5 = ctx.fillStyle; ctx.globalAlpha = 0.3; ctx.fillStyle = ColorManager.Current.Leaderboard_Background; ctx.fillRect(_0x30810d, _0x3945e5, _0x480b7b, _0x2dab2b); ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.Leaderboard_LastWinner; ctx.font = _0x480a1a + "px Ubuntu"; ctx.fillText(lastWinner, _0x30810d + _0x24ddab - ctx.measureText(lastWinner).width / 0x2, _0x3945e5 + _0x480a1a * 0x2); var _0x3c3536 = 0x0; for (let _0x547929 = 0x0; _0x547929 < _0xa4e3df; _0x547929++) { let _0x28da20 = _0x1525be[_0x547929]; let _0xb550ee = "AgarZ.com"; if (_0x28da20.name != null) { _0xb550ee = _0x28da20.name.trim(); if (_0xb550ee == '') { _0xb550ee = 'AgarZ.com'; } } let _0x3f3427; if (!noRanking) { _0x3f3427 = '' + (_0x547929 + 0x1) + ". " + _0xb550ee; } else { _0x3f3427 = _0xb550ee; } let _0x1252fb = ctx.measureText(_0x3f3427).width; if (_0x28da20.id == spectatorId) { ctx.fillStyle = ColorManager.Current.Leaderboard_Spectator; } else { if (_0x28da20.id == playerId) { ctx.fillStyle = ColorManager.Current.Leaderboard_Player; } else { ctx.fillStyle = ColorManager.Current.Leaderboard_Default; var _0x12b996 = getLeaderboardExt(_0x28da20.id); if (_0x12b996 != null) { if (_0x12b996.sameTeam == 0x1) { ctx.fillStyle = ColorManager.Current.Name_SameTeamOnList; } else if (_0x12b996.sameClan == 0x1) { ctx.fillStyle = ColorManager.Current.Name_SameClanOnList; } } } } _0x3c3536 = _0x3945e5 + _0x480a1a * 0x4 + _0x480a1a * 1.2 * _0x547929; _0x28da20.draw_x = mainCanvas.width - _0x480b7b + _0x24ddab - _0x1252fb / 0x2; _0x28da20.draw_y = _0x3c3536; _0x28da20.draw_w = _0x1252fb; _0x28da20.draw_h = _0x480a1a; ctx.fillText(_0x3f3427, _0x28da20.draw_x, _0x28da20.draw_y); } if (leaderboardIndex >= _0xa4e3df && playMode == 0x1) { let _0x4a6932 = leaderboardIndex + 0x1 + ". " + playerName; let _0xa5cc91 = ctx.measureText(_0x4a6932).width; let _0x54cae2 = mainCanvas.width - _0x480b7b + _0x24ddab - _0xa5cc91 / 0x2; _0x3c3536 += _0x480a1a; ctx.fillStyle = ColorManager.Current.Leaderboard_Player; ctx.fillText(_0x4a6932, _0x54cae2, _0x3c3536); } ctx.fillStyle = _0x44bdd5; break; case 0x2: prog_rect.draw(_0x30810d, _0x3945e5, _0x480b7b, _0x2dab2b, ColorManager.Current_RGB_GL.Leaderboard_Background, 0.8); var _0x230347 = _0x30810d + _0x24ddab - prog_font.getTextWidth(lastWinner) * _0x480a1a / 0x2; var _0x465633 = _0x3945e5 + _0x480a1a * 0x2; prog_font.drawUI(_0x230347, _0x465633, ColorManager.Current_RGB_GL.Leaderboard_LastWinner, 0x1, _0x480a1a, lastWinner); var _0x3c3536 = 0x0; for (let _0x2d5814 = 0x0; _0x2d5814 < _0xa4e3df; _0x2d5814++) { let _0x53a092 = _0x1525be[_0x2d5814]; let _0x5af452 = 'AgarZ.com'; if (_0x53a092.name != null) { _0x5af452 = _0x53a092.name.trim(); if (_0x5af452 == '') { _0x5af452 = "AgarZ.com"; } } let _0x4630d4; if (!noRanking) { _0x4630d4 = '' + (_0x2d5814 + 0x1) + ". " + _0x5af452; } else { _0x4630d4 = _0x5af452; } let _0x476690 = prog_font.getTextWidth(_0x4630d4) * _0x480a1a; let _0x19f02b; if (_0x53a092.id == spectatorId) { _0x19f02b = ColorManager.Current_RGB_GL.Leaderboard_Spectator; } else { if (_0x53a092.id == playerId) { _0x19f02b = ColorManager.Current_RGB_GL.Leaderboard_Player; } else { _0x19f02b = ColorManager.Current_RGB_GL.Leaderboard_Default; var _0x12b996 = getLeaderboardExt(_0x53a092.id); if (_0x12b996 != null) { if (_0x12b996.sameTeam == 0x1) { _0x19f02b = ColorManager.Current_RGB_GL.Name_SameTeamOnList; } else if (_0x12b996.sameClan == 0x1) { _0x19f02b = ColorManager.Current_RGB_GL.Name_SameClanOnList; } } } } _0x3c3536 = _0x3945e5 + _0x480a1a * 0x4 + _0x480a1a * 1.2 * _0x2d5814; _0x53a092.draw_x = mainCanvas.width - _0x480b7b + _0x24ddab - _0x476690 / 0x2; _0x53a092.draw_y = _0x3c3536; _0x53a092.draw_w = _0x476690; _0x53a092.draw_h = _0x480a1a; prog_font.drawUI(_0x53a092.draw_x, _0x53a092.draw_y, _0x19f02b, 0x1, _0x480a1a, _0x4630d4); } break; } } function Cell(_0x22baf1, _0x2f139f, _0x4f8c0d, _0x4a0233, _0x2c8b4a, _0x2e0339, _0x418065) { this.id = _0x22baf1; this.x_old = _0x2f139f; this.x_draw = _0x2f139f; this.x_new = _0x2f139f; this.y_old = _0x4f8c0d; this.y_draw = _0x4f8c0d; this.y_new = _0x4f8c0d; this.size_old = _0x4a0233; this.size_draw = _0x4a0233; this.size_new = _0x4a0233; this.color = _0x2c8b4a; this.rgb = _0x2e0339; this.rgb_gl = []; this.make_rgb_gl(); this.points = []; this.pointsAdd = []; this.name = _0x418065; this.createTime = new Date().getTime(); } Cell.prototype = { 'id': 0x0, 'pID': 0x0, 'points': null, 'pointsAdd': null, 'name': null, 'nameWidth': 0x0, 'skinName': null, 'skinList': [], 'skinIndex': 0x0, 'x_draw': 0x0, 'y_draw': 0x0, 'size_draw': 0x0, 'x_old': 0x0, 'y_old': 0x0, 'size_old': 0x0, 'x_new': 0x0, 'y_new': 0x0, 'size_new': 0x0, 'scoreWidth': 0x0, 'cellType': 0x0, 'fancy': null, 'updateTime': 0x0, 'tailDbg': [], 'nodeDbg': [], 'updateCounter': 0x0, 'createTime': new Date().getTime(), 'make_rgb_gl': function () { if (this.rgb != null && this.rgb.length == 0x3) { this.rgb_gl = [this.rgb[0x0] / 0xff, this.rgb[0x1] / 0xff, this.rgb[0x2] / 0xff]; } }, 'destroy': function () { cellManager.remove(this); }, 'getNameSize': function () { return Math.max(~~(0.3 * this.size_old), 0x18); }, 'calcNameWidth': function () { switch (renderMode) { case 0x1: ctx.font = this.getNameSize() + "px Ubuntu"; this.nameWidth = ctx.measureText(this.name).width; break; case 0x2: this.nameWidth = prog_font.getTextWidth(this.name) * this.getNameSize(); break; } }, 'calcScoreWidth': function (_0x26c540) { _0x26c540.font = this.getNameSize() + "px Ubuntu"; this.scoreWidth = _0x26c540.measureText(this.getScore()).width; }, 'setSkinName': function (_0xa393a7) { this.skinList = _0xa393a7.split(';'); this.skinName = this.skinList[this.skinIndex]; }, 'changeSkin': function () { if (this.skinList[0x0] == '?k') { this.skinIndex = (changeSkinCounter + this.id) % (this.skinList.length - 0x1) + 0x1; } else { this.skinIndex = changeSkinCounter % this.skinList.length; } }, 'createPoints': function (_0x194720) { for (var _0x5019a3 = 0x0; _0x5019a3 < this.fancy.pointsLength; _0x5019a3++) { this.points.push({ 'size': this.size_draw, 'x': this.x_new, 'y': this.y_new }); this.pointsAdd.push(Math.random() - 0.5); } }, 'movePoints': function () { for (i = 0x0; i < this.pointsAdd.length; ++i) { var _0x2319a8 = this.pointsAdd[(i - 0x1 + this.pointsAdd.length) % this.pointsAdd.length]; var _0x18fd5a = this.pointsAdd[(i + 0x1) % this.pointsAdd.length]; this.pointsAdd[i] += (Math.random() - 0.5) * this.fancy.distortionHeight; if (this.pointsAdd[i] > this.fancy.distortionMax) { this.pointsAdd[i] = this.fancy.distortionMax; } else if (this.pointsAdd[i] < -this.fancy.distortionMax) { this.pointsAdd[i] = -this.fancy.distortionMax; } this.pointsAdd[i] = (_0x2319a8 + _0x18fd5a + this.fancy.distortionWide * this.pointsAdd[i]) / (this.fancy.distortionWide + 0x2); } var _0x37f1e1 = 0x2 * Math.PI / this.points.length; for (j = 0x0; j < this.points.length; ++j) { var _0x5b9cfc = this.points[j].size + this.pointsAdd[j]; var _0x53b93f = 0x0; if (this.cellType == 0x2 || this.cellType == 0x5) { _0x53b93f = 0x0; if (j % this.fancy.spikeMod == 0x0) { _0x5b9cfc += this.fancy.spikeSize; } } else { _0x53b93f = (this.id / 0x3e8 + timestamp / 0x2710) % (0x2 * Math.PI); } this.points[j].x_draw = this.x_draw + Math.cos(_0x37f1e1 * j + _0x53b93f) * _0x5b9cfc; this.points[j].y_draw = this.y_draw + Math.sin(_0x37f1e1 * j + _0x53b93f) * _0x5b9cfc; } }, 'updatePos': function () { var _0x5c104d = new Date().getTime() - updateNodes2_last; var _0x3a3e51; if (options.get("quickSplit") == true) { _0x3a3e51 = _0x5c104d / updateNodes2_span; } else { _0x3a3e51 = (timestamp - this.updateTime) / 0x78; } if (_0x3a3e51 < 0x0) { _0x3a3e51 = 0x0; } else if (_0x3a3e51 > 0x1) { _0x3a3e51 = 0x1; } this.x_draw = _0x3a3e51 * (this.x_new - this.x_old) + this.x_old; this.y_draw = _0x3a3e51 * (this.y_new - this.y_old) + this.y_old; this.size_draw = _0x3a3e51 * (this.size_new - this.size_old) + this.size_old; if (this.tailDbg.length > 0x3e8) { this.tailDbg.shift(); } }, 'getScore': function () { var _0x11aab8 = ~~(this.size_new * this.size_new / 0x64); return _0x11aab8; }, 'drawSimple': function (_0x1d471b) { if (this.size_draw <= 0x0) { console.log("ctx.arc radius negatif değer olamaz! " + this.size_draw); } else { _0x1d471b.beginPath(); _0x1d471b.arc(this.x_draw, this.y_draw, this.size_draw, 0x0, 0x2 * Math.PI, false); } }, 'drawFancy': function (_0x18e179) { _0x18e179.lineWidth = this.fancy.lineWidth; _0x18e179.lineCap = "round"; _0x18e179.lineJoin = this.fancy.lineJoin; _0x18e179.beginPath(); _0x18e179.moveTo(this.points[0x0].x_draw, this.points[0x0].y_draw); for (var _0x48ff7a = 0x1; _0x48ff7a < this.points.length; _0x48ff7a++) { _0x18e179.lineTo(this.points[_0x48ff7a].x_draw, this.points[_0x48ff7a].y_draw); } _0x18e179.closePath(); }, 'isDrawSkin': function () { return options.get('showSkin') && this.skinName != '' && this.skinName != null; }, 'isDrawName': function () { return options.get('showName') && this.name || this.pID == playerId; }, 'getClanName': function () { var _0x7f9ff2 = playerInfoList[this.pID]; return _0x7f9ff2 != null && _0x7f9ff2.clan_status > 0x0 ? clanNameList[_0x7f9ff2.clan_id] : null; }, 'isDrawClan': function () { if (options.get("showClanName")) { var _0x8c43c6 = this.getClanName(); return _0x8c43c6 != null; } return false; }, 'isDrawScore': function () { return options.get('showScore') == true; }, 'isDrawUID': function () { return true && typeof isAdmin !== "undefined" && spectatorPlayer != null && spectatorPlayer.pid == this.pID; }, 'drawOneCell_player_ctx': function () { if (options.get("transparentRender") == true) { ctx.globalAlpha = 0.6; } else { ctx.globalAlpha = 0x1; } if (this.tailDbg.length > 0x0) { ctx.strokeStyle = "#FFFFFF"; ctx.lineWidth = 0x1; for (var _0x1851f8 = 0x0; _0x1851f8 < this.tailDbg.length; _0x1851f8++) { ctx.strokeStyle = "rgba(255,255,255)"; ctx.beginPath(); ctx.arc(this.tailDbg[_0x1851f8].x, this.tailDbg[_0x1851f8].y, 0x5, 0x0, 0x2 * Math.PI, false); ctx.stroke(); } } if (this.nodeDbg.length > 0x0) { ctx.strokeStyle = '#FF0000'; ctx.lineWidth = 0x1; for (var _0x1851f8 = 0x0; _0x1851f8 < this.nodeDbg.length; _0x1851f8++) { ctx.beginPath(); ctx.arc(this.nodeDbg[_0x1851f8].x, this.nodeDbg[_0x1851f8].y, 0x6, 0x0, 0x2 * Math.PI, false); ctx.stroke(); } } ctx.fillStyle = this.color; this.drawSimple(ctx); ctx.fill(); if (this.isDrawSkin()) { var _0x378640 = "//cdn.agarz.com/" + this.skinName; if (skins.hasOwnProperty(this.skinName) == false) { skins[this.skinName] = new Image(); skins[this.skinName].src = _0x378640; if (skins[this.skinName].src.endsWith(".png") === false) { skins[this.skinName].src += ".png"; } skins[this.skinName].onload = function () { skinsLoaded[this.skinName] = true; }.bind(this); } if (skinsLoaded.hasOwnProperty(this.skinName)) { var _0x284df0 = skins[this.skinName]; ctx.save(); ctx.clip(); ctx.drawImage(_0x284df0, this.x_draw - this.size_draw, this.y_draw - this.size_draw, 0x2 * this.size_draw, 0x2 * this.size_draw); ctx.restore(); var _0x59c92b = playerInfoList[this.pID]; if (_0x59c92b != null && _0x59c92b.userId == record_uid && record_uid != 0x0) { ctx.drawImage(crownImage, this.x_draw - this.size_draw * 0.5, this.y_draw - this.size_draw * 0x2, this.size_draw, this.size_draw); } } } ctx.globalAlpha = 0x1; var _0x4d0f58 = ColorManager.Current.Name_Default; if (this.pID == playerId) { _0x4d0f58 = ColorManager.Current.Name_Default; } else { var _0x458f2d = getLeaderboardExt(this.pID); if (_0x458f2d == null) { _0x4d0f58 = ColorManager.Current.Name_Default; } else { if (_0x458f2d.sameTeam == 0x1) { _0x4d0f58 = ColorManager.Current.Name_SameTeamOnList; } else if (_0x458f2d.sameClan == 0x1) { _0x4d0f58 = ColorManager.Current.Name_SameClanOnList; } } } ctx.fillStyle = _0x4d0f58; if (this.isDrawName()) { ctx.font = this.getNameSize() + "px Ubuntu"; this.calcNameWidth(ctx); var _0x494d15 = this.x_draw - this.nameWidth * 0.5; ctx.fillText(this.name, _0x494d15, this.y_draw); } if (this.isDrawClan()) { var _0x2bb92b = this.getClanName(); var _0x55d4d6 = Math.floor(this.getNameSize() * 0.5); ctx.font = _0x55d4d6 + "px Ubuntu"; var _0x579b10 = ctx.measureText(_0x2bb92b).width; var _0x494d15 = this.x_draw - _0x579b10 * 0.5; ctx.fillText(_0x2bb92b, _0x494d15, this.y_draw - _0x55d4d6 * 0x2); } if (this.isDrawScore()) { ctx.font = this.getNameSize() + "px Ubuntu"; var _0xab03f2 = this.getScore(); var _0x42b45f = _0xab03f2.dotFormat(); var _0x494d15 = this.x_draw - this.scoreWidth * 0.5; ctx.fillText(_0x42b45f, _0x494d15, this.y_draw + this.getNameSize()); } if (this.isDrawUID()) { ctx.font = this.getNameSize() + "px Ubuntu"; var _0x42b45f = spectatorPlayer.uid; var _0x5912fa = ctx.measureText(_0x42b45f).width; var _0x494d15 = this.x_draw - _0x5912fa * 0.5; ctx.fillText(_0x42b45f, _0x494d15, this.y_draw - this.getNameSize()); } }, 'drawOneCell_player_gl': function () { if (this.isDrawSkin()) { if (textureSkin.get(this.skinName) == null) { textureSkin.load(this.skinName); } if (textureSkin.isReady(this.skinName)) { textureSkin.bind(this.skinName); prog_cell.draw(this, prog_cell.DRAW_MODE_TEXTURE); } else { prog_cell.draw(this, prog_cell.DRAW_MODE_COLOR); } } else { prog_cell.draw(this, prog_cell.DRAW_MODE_COLOR); } var _0x13b038 = ColorManager.Current_RGB_GL.Name_Default; if (this.pID == playerId) { _0x13b038 = ColorManager.Current_RGB_GL.Name_Default; } else { var _0x312964 = getLeaderboardExt(this.pID); if (_0x312964 == null) { _0x13b038 = ColorManager.Current_RGB_GL.Name_Default; } else { if (_0x312964.sameTeam == 0x1) { _0x13b038 = ColorManager.Current_RGB_GL.Name_SameTeamOnList; } else if (_0x312964.sameClan == 0x1) { _0x13b038 = ColorManager.Current_RGB_GL.Name_SameClanOnList; } } } if (this.isDrawName()) { prog_font.drawGame(this.x_draw, this.y_draw, _0x13b038, 0x1, this.getNameSize(), this.name); } if (this.isDrawClan()) { var _0x1e4a8c = this.getClanName(); var _0x361747 = Math.floor(this.getNameSize() * 0.5); prog_font.drawGame(this.x_draw, this.y_draw - _0x361747 * 0x2, _0x13b038, 0x1, _0x361747, _0x1e4a8c); } if (this.isDrawScore()) { var _0x1f56e2 = this.getScore().dotFormat(); var _0x361747 = this.getNameSize(); prog_font.drawGame(this.x_draw, this.y_draw + _0x361747, _0x13b038, 0x1, _0x361747, _0x1f56e2); } if (this.isDrawUID()) { var _0x361747 = this.getNameSize(); var _0x79c71b = spectatorPlayer.uid.dotFormat() + ''; prog_font.drawGame(this.x_draw, this.y_draw - _0x361747 * 1.5, _0x13b038, 0x1, _0x361747, _0x79c71b); } }, 'drawOneCell_food_ctx': function () { ctx.fillStyle = this.color; ctx.strokeStyle = this.color; this.drawSimple(ctx); ctx.fill(); }, 'drawOneCell_food_gl': function () { prog_cell.draw(this, prog_cell.DRAW_MODE_COLOR); }, 'drawOneCell_virus_ctx': function () { if (options.get('transparentRender') == true) { ctx.globalAlpha = 0.3; } else { ctx.globalAlpha = 0x1; } var _0x271295 = fpsManager.getDeltaTime(); ctx.fillStyle = this.color; ctx.strokeStyle = ColorManager.Current.Virus_Line; if (options.get('simpleGreen') == true || _0x271295 > 0x32) { this.drawSimple(ctx); ctx.fill(); ctx.lineWidth = 0xa; ctx.stroke(); } else { this.movePoints(); this.drawFancy(ctx); ctx.stroke(); ctx.fill(); } }, 'drawOneCell_virus_gl': function () { prog_cell.draw(this, prog_cell.DRAW_MODE_COLOR); }, 'drawOneCell_ejected_ctx': function () { ctx.fillStyle = this.color; ctx.strokeStyle = this.color; this.drawSimple(ctx); ctx.fill(); }, 'drawOneCell_ejected_gl': function () { prog_cell.draw(this, prog_cell.DRAW_MODE_COLOR); }, 'drawOneCell_redVirus_ctx': function () { if (options.get('transparentRender') == true) { ctx.globalAlpha = 0.3; } else { ctx.globalAlpha = 0x1; } var _0x77f783 = fpsManager.getDeltaTime(); ctx.fillStyle = this.color; ctx.strokeStyle = ColorManager.Current.RedVirus_Line; if (options.get("simpleGreen") == true || _0x77f783 > 0x32) { this.drawSimple(ctx); ctx.fill(); ctx.lineWidth = 0xa; ctx.stroke(); } else { this.movePoints(); this.drawFancy(ctx); ctx.stroke(); ctx.fill(); } }, 'drawOneCell_gold_ctx': function () { ctx.fillStyle = ColorManager.Current.Gold; this.drawFancy(ctx); ctx.fill(); }, 'drawOneCell': function () { switch (this.cellType) { case 0x0: switch (renderMode) { case 0x1: this.drawOneCell_player_ctx(); break; case 0x2: this.drawOneCell_player_gl(); break; case 0x3: this.drawOneCell_player_ctx(); this.drawOneCell_player_gl(); break; } break; case 0x1: switch (renderMode) { case 0x1: this.drawOneCell_food_ctx(); break; case 0x2: this.drawOneCell_food_gl(); break; case 0x3: this.drawOneCell_food_ctx(); this.drawOneCell_food_gl(); break; } break; case 0x2: switch (renderMode) { case 0x1: this.drawOneCell_virus_ctx(); break; case 0x2: this.drawOneCell_virus_gl(); break; } break; case 0x3: switch (renderMode) { case 0x1: this.drawOneCell_ejected_ctx(); break; case 0x2: this.drawOneCell_ejected_gl(); break; case 0x3: this.drawOneCell_ejected_ctx(); this.drawOneCell_ejected_gl(); break; } break; case 0x5: this.drawOneCell_redVirus_ctx(); break; case 0x4: this.drawOneCell_gold_ctx(); break; default: console.log("CellType bilinmiyor:" + this.cellType); break; } } }; function getBoardArea() { var _0x30b07a = Math.min(leftPos, rightPos); var _0x6bf506 = Math.max(leftPos, rightPos); var _0x272f55 = (_0x30b07a + _0x6bf506) / 0x2; var _0x2df88e = Math.min(topPos, bottomPos); var _0xb31a89 = Math.max(topPos, bottomPos); var _0x2798d4 = (_0x2df88e + _0xb31a89) / 0x2; return { 'x_min': _0x30b07a, 'x_mid': _0x272f55, 'x_max': _0x6bf506, 'y_min': _0x2df88e, 'y_mid': _0x2798d4, 'y_max': _0xb31a89, 'isInside': function (_0x141561, _0x4e2cd3) { return !!(_0x141561 >= _0x30b07a && _0x141561 <= _0x6bf506 && _0x4e2cd3 >= _0x2df88e && _0x4e2cd3 <= _0xb31a89); } }; } const cellManager = new function () { this.cellList = []; this.cellObject = {}; this.playerCellIdList = []; this.playerCellList = []; this.recordList = []; this.recordN = 0x0; this.recordFrameTime = 0x0; this.recordSecond = 0x5; this.drawMode = 0x0; this.add = function (_0x2a9e6e) { this.cellList.push(_0x2a9e6e); this.cellObject[_0x2a9e6e.id] = _0x2a9e6e; }; this.remove = function (_0x462067) { for (var _0x239fb3 = 0x0; _0x239fb3 < this.cellList.length; _0x239fb3++) { if (this.cellList[_0x239fb3] == _0x462067) { this.cellList.splice(_0x239fb3, 0x1); break; } } delete this.cellObject[_0x462067.id]; var _0x1379f6 = this.playerCellList.indexOf(_0x462067); if (_0x1379f6 != -0x1) { this.playerCellList.splice(_0x1379f6, 0x1); } var _0x3f4ade = this.playerCellIdList.indexOf(_0x462067.id); if (_0x3f4ade != -0x1) { this.playerCellIdList.splice(_0x3f4ade, 0x1); } }; this.clearActive = function () { this.cellList = []; this.cellObject = {}; this.playerCellIdList = []; this.playerCellList = []; }; this.clearRecord = function () { this.recordList = []; this.recordN = 0x0; this.recordFrameTime = 0x0; }; this.newRecord = function () { var _0x381510 = { leaderBoard: [] }; for (var _0x2ec33a = 0x0; _0x2ec33a < leaderBoard.length; _0x2ec33a++) { var _0x4cf96d = Object.assign({}, leaderBoard[_0x2ec33a]); _0x381510.leaderBoard.push(_0x4cf96d); } _0x381510.countdown = countdown; _0x381510.cellList = []; for (var _0x2ec33a = 0x0; _0x2ec33a < this.cellList.length; _0x2ec33a++) { var _0x4cf96d = new Cell(); Object.assign(_0x4cf96d, this.cellList[_0x2ec33a]); _0x381510.cellList.push(_0x4cf96d); } _0x381510.cellObject = Object.assign({}, this.cellObject); _0x381510.playerCellList = []; for (var _0x2ec33a = 0x0; _0x2ec33a < this.playerCellList.length; _0x2ec33a++) { var _0x4cf96d = new Cell(); Object.assign(_0x4cf96d, this.playerCellList[_0x2ec33a]); _0x381510.playerCellList.push(_0x4cf96d); } _0x381510.playerCellIdList = this.playerCellIdList.slice(); this.recordList.push(_0x381510); if (this.recordList.length > this.recordSecond * 0x14) { this.recordList.shift(); } }; this.getCellList = function () { if (this.drawMode == 0x0) { return this.cellList; } else { var _0xa68658 = this.getReplayItem(); return _0xa68658 != null ? _0xa68658.cellList : null; } }; this.getReplayItem = function () { if (this.recordList.length == 0x0) { return null; } if (this.recordN < 0x0) { this.recordN = 0x0; } else if (this.recordN >= this.recordList.length) { this.recordN = this.recordList.length - 0x1; } return this.recordList[this.recordN]; }; this.drawReplay = function () { var _0x403a5b = this.getReplayItem(); if (_0x403a5b == null) { return; } var _0x174a1c = []; for (var _0x5cb219 = 0x0; _0x5cb219 < _0x403a5b.cellList.length; _0x5cb219++) { var _0x1f390d = _0x403a5b.cellList[_0x5cb219]; _0x1f390d.drawOneCell(); if (spectatorId == _0x1f390d.pID || playerId == _0x1f390d.pID) { if (options.get("drawEdge")) { _0x174a1c.push(_0x1f390d); } } } }; this.updateAndDraw = function () { var _0xa1e5a = []; var _0x5a2e52 = fpsManager.getDeltaTime(); for (var _0x2859e1 = 0x0; _0x2859e1 < this.cellList.length; _0x2859e1++) { var _0x294b15 = this.cellList[_0x2859e1]; if ((_0x294b15.cellType == 0x1 || _0x294b15.cellType == 0x3) && _0x5a2e52 > 0x64) {} else { _0x294b15.updatePos(); _0x294b15.drawOneCell(); if (spectatorId == _0x294b15.pID || playerId == _0x294b15.pID) { if (options.get('drawEdge')) { _0xa1e5a.push(_0x294b15); } } } } switch (renderMode) { case 0x1: ctx.strokeStyle = ColorManager.Current.CellBorder; ctx.lineWidth = 0x1 / cameraManager.scale; for (var _0x2859e1 = 0x0; _0x2859e1 < _0xa1e5a.length; _0x2859e1++) { if (_0xa1e5a[_0x2859e1].size_draw >= 0x0) { ctx.beginPath(); ctx.arc(_0xa1e5a[_0x2859e1].x_draw, _0xa1e5a[_0x2859e1].y_draw, _0xa1e5a[_0x2859e1].size_draw, 0x0, 0x2 * Math.PI, false); ctx.stroke(); } } break; case 0x2: for (var _0x2859e1 = 0x0; _0x2859e1 < _0xa1e5a.length; _0x2859e1++) { prog_cell.drawLine(_0xa1e5a[_0x2859e1]); } break; } }; this.drawAuto = function (_0x297c9d) { if (renderMode == 0x1) { if (options.get('transparentRender') == true) { _0x297c9d.globalAlpha = 0.6; } else { _0x297c9d.globalAlpha = 0x1; } } switch (this.drawMode) { case 0x0: this.updateAndDraw(); break; case 0x2: if (this.recordList.length > 0x0) { this.drawReplay(); } else { this.drawMode = 0x0; } break; case 0x1: if (this.recordList.length > 0x0) { this.drawReplay(); var _0x34ab07 = fpsManager.lastUpdateFrameTime - this.recordFrameTime; if (_0x34ab07 >= 0x32) { this.recordFrameTime = fpsManager.lastUpdateFrameTime; if (this.recordN == this.recordList.length - 0x1) {} else { this.recordN++; } } } else { this.drawMode = 0x0; } break; } }; this.getViewArea = function () { var _0x5f51b6 = null; var _0x211b8f = null; var _0x49b69c = null; var _0x3d3b2a = null; var _0x52ce5d = -0x1; if (spectatorId != -0x1) { _0x52ce5d = spectatorId; } else { if (playerId != -0x1) { _0x52ce5d = playerId; } else { return null; } } var _0x1d3ff5 = getBoardArea(); var _0x562126 = this.cellList; if (this.drawMode == 0x1 || this.drawMode == 0x2) { var _0x2c3a18 = this.getReplayItem(); if (_0x2c3a18 != null) { _0x562126 = _0x2c3a18.cellList; } } var _0x37e16a = 0x0; for (var _0x1e97f3 = 0x0; _0x1e97f3 < _0x562126.length; _0x1e97f3++) { var _0x500897 = _0x562126[_0x1e97f3]; if (_0x500897.pID == _0x52ce5d && _0x1d3ff5.isInside(_0x500897.x_draw, _0x500897.y_draw)) { _0x37e16a++; _0x489d67 = _0x500897.x_draw - _0x500897.size_draw; if (_0x489d67 < _0x5f51b6 || _0x5f51b6 == null) { _0x5f51b6 = _0x489d67; } _0x489d67 = _0x500897.x_draw + _0x500897.size_draw; if (_0x489d67 > _0x211b8f || _0x211b8f == null) { _0x211b8f = _0x489d67; } var _0x489d67 = _0x500897.y_draw - _0x500897.size_draw; if (_0x489d67 < _0x49b69c || _0x49b69c == null) { _0x49b69c = _0x489d67; } _0x489d67 = _0x500897.y_draw + _0x500897.size_draw; if (_0x489d67 > _0x3d3b2a || _0x3d3b2a == null) { _0x3d3b2a = _0x489d67; } } } if (_0x37e16a == 0x0) { return null; } var _0x34cf35 = (_0x5f51b6 + _0x211b8f) / 0x2; var _0x1428ce = (_0x49b69c + _0x3d3b2a) / 0x2; var _0x126117 = _0x211b8f - _0x5f51b6; var _0x959697 = _0x3d3b2a - _0x49b69c; var _0x4dc79e = _0x126117 * _0x959697; return { 'x_min': _0x5f51b6, 'x_mid': _0x34cf35, 'x_max': _0x211b8f, 'y_min': _0x49b69c, 'y_mid': _0x1428ce, 'y_max': _0x3d3b2a, 'x_size': _0x126117, 'y_size': _0x959697, 'volume': _0x4dc79e }; }; this.updatePos = function () { if (this.playerCellList.length > 0x0) { var _0x3f088c = getBoardArea(); for (var _0xca7931 = 0x0; _0xca7931 < this.playerCellList.length; _0xca7931++) { var _0x2b9230 = this.playerCellList[_0xca7931]; if (_0x3f088c.isInside(_0x2b9230.x_draw, _0x2b9230.y_draw)) { _0x2b9230.updatePos(); } } } }; this.sort = function () { this.cellList.sort(function (_0x2c26fb, _0xbedbb2) { return _0x2c26fb.size_draw == _0xbedbb2.size_draw ? _0x2c26fb.id - _0xbedbb2.id : _0x2c26fb.size_draw - _0xbedbb2.size_draw; }); }; this.s2c_updateExt = function (_0x2aae71, _0x1eae32, _0x3b2b36, _0x140f31) { for (var _0x27ceb5 = 0x0; _0x27ceb5 < this.cellList.length; _0x27ceb5++) { if (this.cellList[_0x27ceb5].pID == _0x2aae71) { this.cellList[_0x27ceb5].clan_id = _0x1eae32; this.cellList[_0x27ceb5].name = _0x3b2b36; this.cellList[_0x27ceb5].setSkinName(_0x140f31); } } }; this.s2c_update = function (_0x300a38, _0x54d08b, _0x31bd6c, _0x2269aa, _0x40ad9f, _0x28439f, _0xb48dc2, _0x4d131d, _0x1a71f9, _0x53ff6a) { var _0x5ec7b8 = null; if (this.cellObject.hasOwnProperty(_0x31bd6c)) { _0x5ec7b8 = this.cellObject[_0x31bd6c]; _0x5ec7b8.updateCounter++; _0x5ec7b8.updatePos(); if (options.get("quickSplit") == true) { _0x5ec7b8.x_old = _0x5ec7b8.x_new; _0x5ec7b8.y_old = _0x5ec7b8.y_new; _0x5ec7b8.x_draw = _0x5ec7b8.x_new; _0x5ec7b8.y_draw = _0x5ec7b8.y_new; } else { _0x5ec7b8.x_old = _0x5ec7b8.x_draw; _0x5ec7b8.y_old = _0x5ec7b8.y_draw; } _0x5ec7b8.x_new = _0x2269aa; _0x5ec7b8.y_new = _0x40ad9f; if (_0x5ec7b8.nodeDbg.length > 0x64) { _0x5ec7b8.nodeDbg.shift(); } _0x5ec7b8.size_old = _0x5ec7b8.size_new; _0x5ec7b8.size_draw = _0x5ec7b8.size_new; _0x5ec7b8.size_new = _0x28439f; _0x5ec7b8.color = _0xb48dc2; _0x5ec7b8.rgb = _0x4d131d; _0x5ec7b8.make_rgb_gl(); } else { _0x5ec7b8 = new Cell(_0x31bd6c, _0x2269aa, _0x40ad9f, _0x28439f, _0xb48dc2, _0x4d131d, ''); this.cellObject[_0x31bd6c] = _0x5ec7b8; _0x5ec7b8.clan_id = 0x0; _0x5ec7b8.updateCounter = 0x1; _0x5ec7b8.x_old = _0x5ec7b8.x_new; _0x5ec7b8.x_draw = _0x5ec7b8.x_new; _0x5ec7b8.x_new = _0x2269aa; _0x5ec7b8.y_old = _0x5ec7b8.y_new; _0x5ec7b8.y_draw = _0x5ec7b8.y_new; _0x5ec7b8.y_new = _0x40ad9f; _0x5ec7b8.size_old = _0x5ec7b8.size_new; _0x5ec7b8.size_draw = _0x5ec7b8.size_new; _0x5ec7b8.size_new = _0x28439f; var _0x280d8b = fancyCell.get(_0x1a71f9); if (_0x280d8b != null) { _0x5ec7b8.fancy = _0x280d8b; _0x5ec7b8.createPoints(); _0x5ec7b8.movePoints(); } this.add(_0x5ec7b8); } _0x5ec7b8.pID = _0x53ff6a; _0x5ec7b8.calcScoreWidth(_0x300a38); _0x5ec7b8.updateTime = _0x54d08b; _0x5ec7b8.cellType = _0x1a71f9; if (this.playerCellIdList.indexOf(_0x31bd6c) != -0x1 && this.playerCellList.indexOf(_0x5ec7b8) == -0x1) { document.getElementById("overlays").style.display = "none"; this.playerCellList.push(_0x5ec7b8); if (this.playerCellList.length == 0x1) { drawMapDstPoint = true; } } }; this.s2c_destroy = function (_0x3c129a) { var _0x5cd713 = this.cellObject[_0x3c129a]; if (_0x5cd713 != null) { _0x5cd713.destroy(); } }; setInterval(function () { changeSkinCounter++; for (var _0x24da1e = 0x0; _0x24da1e < this.cellList.length; _0x24da1e++) { var _0x484338 = this.cellList[_0x24da1e]; _0x484338.changeSkin(); } }.bind(this), 0x7d0); }(); const cameraManager = new function () { this.translate_x = (leftPos + rightPos) / 0x2; this.translate_y = (topPos + bottomPos) / 0x2; this.translate_x_current = this.translate_x; this.translate_y_current = this.translate_y; this.scaleMin = 0.009; this.scaleDefault = 0.3; this.scaleMax = 0x1; this.scale = this.scaleDefault; this.wheelZoomSpeed = 0.2; this.update = function () { if (viewArea == null) { return; } var _0x2f3aa7 = viewArea.x_size * this.scale / mainCanvas.width; var _0x495ae8 = viewArea.y_size * this.scale / mainCanvas.height; if (_0x495ae8 > 0x1) { tutorial_zoom.onZoomMaxEvent(); this.scale = mainCanvas.height / viewArea.y_size; this.scaleCurrent = this.scale; } else if (_0x2f3aa7 > 0x1) { tutorial_zoom.onZoomMaxEvent(); this.scale = mainCanvas.width / viewArea.x_size; this.scaleCurrent = this.scale; } if (zoomVector != 0x0) { var _0x1dd8d7 = zoomVector * 0.1 / fpsManager.fps; this.scaleChange(_0x1dd8d7); } this.translate_x = viewArea.x_mid; this.translate_y = viewArea.y_mid; var _0x346b1b = 0.5; var _0x2e2b1c = this.translate_x - this.translate_x_current; var _0x1d308e = this.translate_y - this.translate_y_current; var _0x3521c0 = Math.sqrt(_0x2e2b1c * _0x2e2b1c + _0x1d308e * _0x1d308e); if (_0x3521c0 > 0x64) { _0x346b1b = 0.1; } this.translate_x_current += _0x2e2b1c * _0x346b1b; this.translate_y_current += _0x1d308e * _0x346b1b; }; this.useGoldEffect = function () { if (!isGoldUsing) { return; } if (viewArea == null) { return; } var _0x3384fd = viewArea.x_size * this.scale * viewArea.y_size * this.scale; var _0x4b61f3 = mainCanvas.width * mainCanvas.height; var _0x21b82b = _0x4b61f3 / _0x3384fd; if (_0x21b82b < 0x5) { var _0x513fa5 = fpsManager.fps; this.scaleChange(-0.15 / (_0x513fa5 * _0x21b82b)); } }; this.convertPixelToGame = function (_0x27f325, _0x32cc55) { return { 'x': this.translate_x + (_0x27f325 - mainCanvas.width / 0x2) / this.scale, 'y': this.translate_y + (_0x32cc55 - mainCanvas.height / 0x2) / this.scale }; }; this.getMouseCoordinate = function () { return this.convertPixelToGame(rawMouseX, rawMouseY); }; this.scaleSet = function (_0x81b9b7) { this.scale = _0x81b9b7; if (this.scale < this.scaleMin) { this.scale = this.scaleMin; } else if (this.scale > this.scaleMax) { this.scale = this.scaleMax; } }; this.scaleChange = function (_0x51d75d) { this.scaleSet(this.scale + _0x51d75d); }; this.zoom = function (_0x5e30ab) { this.scaleChange(_0x5e30ab); }; this.onMouseWheel = function (_0x4cc83b) { this.scaleChange(0.01 * Math.sign(_0x4cc83b)); }; this.onSendStart = function () { this.scale = this.scaleDefault; }; }(); var spectatorPlayer = null; var plList = []; var chatBoard = []; var playMode = 0x0; var skipPopupOnClose = false; var spectatorId = -0x1; var playerId = -0x1; var playerUserId = 0x0; var playerName = '!'; var gold = 0x0; var goldDiff = 0x0; var options = new function () { this.defaultValues = []; this.onchangecustom = []; this.init = function () { if (isMobile) { this.yesno_settings = document.getElementById("yesno_settings_mobile"); } else { this.yesno_settings = document.getElementById('yesno_settings'); } }; this.get = function (_0x161b27) { if (localStorage[_0x161b27] == null) { return this.defaultValues[_0x161b27]; } return localStorage[_0x161b27] === 'true'; }; this.set = function (_0x4fc255, _0x23917d) { localStorage[_0x4fc255] = _0x23917d; }; this.addYesNoSetting = function (_0x5ab088, _0x22cfd7, _0x24479b, _0x486704) { var _0x189197 = document.createElement('LABEL'); var _0x12f0d2 = document.createElement("INPUT"); _0x12f0d2.type = "checkbox"; _0x12f0d2.onchange = function () { localStorage[_0x22cfd7] = this.checked; if (options.onchangecustom[_0x22cfd7] !== null) { options.onchangecustom[_0x22cfd7](); } }; var _0x3b7277 = document.createTextNode(_0x5ab088); _0x189197.appendChild(_0x12f0d2); _0x189197.appendChild(_0x3b7277); this.yesno_settings.appendChild(_0x189197); this.defaultValues[_0x22cfd7] = _0x24479b; _0x12f0d2.checked = this.get(_0x22cfd7); this.onchangecustom[_0x22cfd7] = _0x486704; if (_0x486704 != null) { _0x486704(); } }; }(); function isCellTypeValid(_0x4c5270) { return !(_0x4c5270 != 0x0 && _0x4c5270 != 0x1 && _0x4c5270 != 0x2 && _0x4c5270 != 0x3 && _0x4c5270 != 0x4 && _0x4c5270 != 0x5); } var updateNodes2_prev = 0x0; var updateNodes2_last = 0x1; var updateNodes2_span = 0x1; var viewArea = null; var countdown = 0xe10; var wsList = []; var isLockMouse = 0x0; var lockMouseX = 0x0; var lockMouseY = 0x0; var isLockFood = 0x0; var yesno_settings; var teamSent = ''; var crownImage = new Image(); crownImage.src = "//agarz.com/imgs/crown2.png"; var record_uid = -0x1; var chatFilter = null; var goldToPrizeTime = 0x0; var autoBigTime = 0x0; var tutorial_zoom = new function () { this.image_warn = new Image(); this.image_warn.src = "//agarz.com/imgs/mouse_wheel_13_w256.png"; this.image_ok = new Image(); this.image_ok.src = "//agarz.com/imgs/mouse_wheel_14_w256_ok.png"; if (localStorage.tutorial_zoom_completed === "true" || isTouchDevice == true || navigator.userAgent.toLowerCase().match(/mobile/i) == true || mouseDetected == false) { this.state = 0x3; } else { this.state = 0x0; } this.stateChangeTime = 0x0; this.drawImage = function (_0x36cb32, _0x399bf3) { _0x36cb32.drawImage(_0x399bf3, mainCanvas.width * 0.5 - _0x399bf3.width * 0.5, mainCanvas.height * 0.5 - _0x399bf3.height * 0.5, _0x399bf3.width, _0x399bf3.height); }; this.setStateIf = function (_0x1031df, _0x95cff8) { if (this.state == _0x1031df) { this.setState(_0x95cff8); } }; this.setState = function (_0x4add0c) { this.state = _0x4add0c; this.stateChangeTime = fpsManager.lastUpdateFrameTime; }; this.onMouseWheel = function () { this.setStateIf(0x1, 0x2); }; this.onZoomMaxEvent = function () { this.setStateIf(0x0, 0x1); }; this.draw = function (_0x44d93c) { switch (this.state) { case 0x0: break; case 0x1: this.drawImage(_0x44d93c, this.image_warn); break; case 0x2: this.drawImage(_0x44d93c, this.image_ok); var _0x51f438 = fpsManager.lastUpdateFrameTime - this.stateChangeTime; if (_0x51f438 > 0x7d0) { localStorage.tutorial_zoom_completed = true; this.setState(0x3); } break; case 0x3: break; } }; }(); const fancyCell = new function () { this.cellTypeList = {}; this.add = function (_0x546540, _0x28d98e, _0x5b61d6, _0x18a07c, _0x511f01, _0x1e728c, _0x429294, _0x572c29, _0x510ab5) { this.cellTypeList[_0x546540] = { 'pointsLength': _0x28d98e, 'lineWidth': _0x5b61d6, 'lineJoin': _0x18a07c, 'distortionMax': _0x511f01, 'distortionHeight': _0x1e728c, 'distortionWide': _0x429294, 'spikeMod': _0x572c29, 'spikeSize': _0x510ab5 }; }; this.get = function (_0x15d47f) { return this.cellTypeList[_0x15d47f]; }; this.add(0x2, 0x40, 0xf, "miter", 0x19, 0x5, 0x3, 0x4, 0x32); this.add(0x5, 0x40, 0xf, "miter", 0x19, 0x5, 0x3, 0x2, 0x32); this.add(0x4, 0x10, 0xf, "miter", 0x37, 0x1e, 0x2, 0x63, 0x32); }(); const fpsManager = new function () { this.counterAll = 0x0; this.counter = 0x0; this.counterStartTime = 0x0; this.fps = 0x1; this.lastUpdateFrameTime = 0x0; this.lastUpdateFrameSpan = 0x0; this.FPS_SPAN_MS = 0x3e8; this.updateFrame = function () { var _0x2021d8 = new Date().getTime(); if (this.lastUpdateFrameTime != 0x0) { this.lastUpdateFrameSpan = _0x2021d8 - this.lastUpdateFrameTime; } this.lastUpdateFrameTime = _0x2021d8; this.counterAll++; if (this.counterStartTime == 0x0) { this.counterStartTime = _0x2021d8; } else { var _0x5ef204 = _0x2021d8 - this.counterStartTime; if (_0x5ef204 >= this.FPS_SPAN_MS) { var _0x3eaa97 = _0x5ef204 / 0x3e8; this.fps = Math.round(this.counter / _0x3eaa97 * 0x2710) / 0x2710; if (this.fps == 0x0) { this.fps = 0x1; } this.counterStartTime = _0x2021d8; this.counter = 0x0; } else { this.counter++; } } }; this.getDeltaTime = function () { return new Date().getTime() - this.lastUpdateFrameTime; }; }(); var keymap = []; keymap[0x0] = 0x20; keymap[0x1] = 0x31; keymap[0x2] = 0x32; var js_load_time = new Date().getTime(); var ping_last = 0x1; var skins = {}; var skinsLoaded = {}; var clanNameList = []; var playerInfoList = []; if (!Number.prototype.dotFormat) { Number.prototype.dotFormat = function (_0x435fd0 = '.') { return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, _0x435fd0); }; } if (!String.prototype.startsWith) { String.prototype.startsWith = function (_0x5e610e, _0xf4e3ff) { _0xf4e3ff = _0xf4e3ff || 0x0; return this.substr(_0xf4e3ff, _0x5e610e.length) === _0x5e610e; }; } if (!Date.now) { Date.now = function () { return new Date().getTime(); }; } var getClanName = function (_0x4df119) { $.ajax({ 'url': "/ajax/clan_name.php", 'method': "POST", 'data': { 'id': _0x4df119 }, 'cache': false }).done(function (_0x22d3c3) { clanNameList[_0x4df119] = _0x22d3c3; }); }; function prepareData(_0x188871) { var _0x45c98d = new ArrayBuffer(_0x188871); return new DataView(_0x45c98d); } function setChatMode(_0x2a0b12, _0x392375) { if (_0x392375 & 0x1) { var _0x1a5cf1 = ''; if (isMobile) { _0x1a5cf1 = '_mobile'; } var _0x464fc9 = document.getElementById("chatToAll" + _0x1a5cf1); var _0x25f69f = document.getElementById("chatToTeam" + _0x1a5cf1); var _0xac8281 = document.getElementById("chatToClan" + _0x1a5cf1); var _0x2207b0 = document.getElementById("chatToAgarZ" + _0x1a5cf1); _0x464fc9.checked = false; _0x25f69f.checked = false; _0xac8281.checked = false; _0x2207b0.checked = false; switch (_0x2a0b12) { case 0x0: _0x464fc9.checked = true; break; case 0x1: _0x25f69f.checked = true; break; case 0x2: _0xac8281.checked = true; break; case 0x3: _0x2207b0.checked = true; break; } } if (_0x392375 & 0x2) { localStorage.chatMode = _0x2a0b12; } } function getPlayerByPID(_0x45650c) { for (var _0x84cfd6 = 0x0; _0x84cfd6 < plList.length; _0x84cfd6++) { if (plList[_0x84cfd6].pid == _0x45650c) { return plList[_0x84cfd6]; } } return null; } function showGeneralError(_0x2b1053, _0x3103e1) { if (typeof _0x3103e1 === "undefined") { _0x3103e1 = ''; } $("#overlays").hide(); $("#generalErrorDialog_line1").html(_0x2b1053); $("#generalErrorDialog_line2").html(_0x3103e1); $("#generalErrorDialog").show(); } ; setInterval(function () { ping(); }, 0xbb8); setInterval(function () { var _0x229cd4 = 0x0; for (var _0x5bb8b2 = 0x0; _0x5bb8b2 < wsList.length - 0x1; _0x5bb8b2++) { if (wsList[_0x5bb8b2] != null && wsList[_0x5bb8b2].readyState == wsList[_0x5bb8b2].OPEN) { try { wsList[_0x5bb8b2].close(); } catch (_0x57d166) {} wsList[_0x5bb8b2] = null; _0x229cd4 = 0x1; console.log(_0x5bb8b2); } } if (_0x229cd4 == 0x1) { wsList.shift(); } }, 0xbb8); function getLangCode() { var _0x27487b = document.getElementsByTagName("html")[0x0].getAttribute("lang"); switch (_0x27487b) { case 'tr': return 'tr'; case 'en': return 'en'; case 'es': return 'es'; case 'de': return 'de'; default: return 'tr'; } } window.onkeypress = function (_0x20b2e8) { var _0x3617fa = $("#overlays").is(":visible"); if (isTyping || _0x3617fa) { return; } switch (_0x20b2e8.code) { case "KeyT": if (isLockMouse == 0x0) { isLockMouse = 0x1; lockMouseX = moveToX; lockMouseY = moveToY; } else { isLockMouse = 0x0; } break; case "KeyR": if (isLockFood == 0x0) { sendUint8(0x16); isLockFood = 0x1; } else { sendUint8(0x17); isLockFood = 0x0; } break; } }; function tryClickChangeSpectator(_0x1e5809, _0x1a1f30) { if (playMode == 0x2) { var _0x5d1f8c = cellManager.getCellList(); var _0x473f7a = cameraManager.convertPixelToGame(_0x1e5809, _0x1a1f30); var _0x4aa4b3 = Number.MAX_SAFE_INTEGER; for (var _0x13b578 = 0x0; _0x13b578 < _0x5d1f8c.length; _0x13b578++) { var _0x448b4d = _0x5d1f8c[_0x13b578]; if (_0x448b4d.cellType == 0x0) { var _0x27f5e5 = _0x448b4d.x_draw - _0x473f7a.x; var _0x2e1c1e = _0x448b4d.y_draw - _0x473f7a.y; var _0x1aecf7 = Math.sqrt(_0x27f5e5 * _0x27f5e5 + _0x2e1c1e * _0x2e1c1e); if (_0x1aecf7 < _0x448b4d.size_draw && _0x448b4d.size_draw < _0x4aa4b3) { _0x4aa4b3 = _0x448b4d.size_draw; spectatorId = _0x448b4d.pID; setSpectator(spectatorId); } } } } } function tryClickSharePosition(_0x4682c9, _0x14a9db) { var _0x75d5b8 = new Date().getTime() - txtpos_lastTime; if (_0x75d5b8 > 0x1388 && _0x4682c9 >= 0xa && _0x4682c9 <= 0xa + txtpos_width && _0x14a9db >= 0xc8 - txtpos_height && _0x14a9db <= 0xc8) { setChatMode(0x0, 3); sendChat(txtpos_share); txtpos_lastTime = new Date().getTime(); } } function tryClickChatName(_0x32aca0, _0x2f5e72) { for (let _0x13394c of chatManager.chatList) { if (_0x13394c.userId != 0x0 && _0x13394c.userId != undefined) { if (_0x32aca0 >= _0x13394c.name_x && _0x32aca0 <= _0x13394c.name_x + _0x13394c.name_w && _0x2f5e72 <= _0x13394c.name_y && _0x2f5e72 >= _0x13394c.name_y - _0x13394c.name_h) { var _0x53f2a2 = window.open('//agarz.com/' + getLangCode() + '/home/' + _0x13394c.userId, "_blank"); _0x53f2a2.focus(); break; } } if (_0x13394c.chat_id != 0x0) { if (_0x32aca0 >= _0x13394c.del_x && _0x32aca0 <= _0x13394c.del_x + _0x13394c.del_w && _0x2f5e72 <= _0x13394c.del_y && _0x2f5e72 >= _0x13394c.del_y - _0x13394c.del_h) { adminChatMenu2.show(_0x13394c.name, _0x13394c.message, _0x13394c.chat_id, _0x13394c.userId); } } } } function mainCanvas_onmousedown(_0x337f5e) { var _0x45a248 = _0x337f5e.clientX; var _0x57f39d = _0x337f5e.clientY; tryClickSharePosition(_0x45a248, _0x57f39d); tryClickChatName(_0x45a248, _0x57f39d); tryClickChangeSpectator(_0x45a248, _0x57f39d); chatManager.updateCursorStyle(_0x45a248, _0x57f39d); } ; function mainCanvas_onmousemove(_0x49a731) { mouseDetected = true; rawMouseX = _0x49a731.clientX; rawMouseY = _0x49a731.clientY; chatManager.updateCursorStyle(rawMouseX, rawMouseY); } ; window.onkeydown = function (_0x40b655) { var _0x647929 = $("#overlays").is(':visible'); switch (_0x40b655.keyCode) { case 0x20: if (!spacePressed && !isTyping && _0x647929 == false) { sendMouseMove(); sendUint8(0x11); spacePressed = true; } break; case 0x31: if (!key1Pressed && !_0x647929) { sendUint8(0x13); key1Pressed = true; } break; case 0x32: if (!key2Pressed && !_0x647929) { sendUint8(0x14); key2Pressed = true; } break; case 0x51: if (!qPressed && _0x647929 == false) { sendUint8(0x12); qPressed = true; } break; case 0x57: if (!wPressed && !isTyping && _0x647929 == false) { sendMouseMove(); sendUint8(0x15); wPressed = true; } break; case 0x1b: if (_0x647929) { $("#overlays").hide(); } else { $("#overlays").show(); } canvasResize(); break; case 0xd: console.log("chat send"); if (isTyping || isMobile) { isTyping = false; sendChatMessage(); } else if (!$("#overlays").is(':visible')) { isTyping = true; } break; case 0x45: if (!ePressed && !isTyping && _0x647929 == false) { ePressed = true; sendUint8(0x16); } break; case 0x41: if (!aPressed && !isTyping && _0x647929 == false) { aPressed = true; sendMouseMove(); sendUint8(0x4); } break; case 0x53: if (!sPressed && !isTyping && _0x647929 == false) { sPressed = true; sendUint8(0x18); } break; case 0x5a: if (!zPressed && !isTyping && _0x647929 == false) { zPressed = true; if (options.get("macro")) { sendUint8(0x23); isGoldUsing = true; } } break; case 0x58: if (!xPressed && !isTyping && _0x647929 == false) { xPressed = true; if (options.get("macro")) { sendUint8(0x24); isGoldUsing = true; } } break; case 0x46: microphone.startRecord(); break; } }; window.onkeyup = function (_0x95551a) { switch (_0x95551a.keyCode) { case 0x20: spacePressed = false; break; case 0x57: wPressed = false; break; case 0x31: if (key1Pressed) { key1Pressed = false; } break; case 0x32: if (key2Pressed) { key2Pressed = false; } break; case 0x51: if (qPressed) { qPressed = false; } break; case 0x45: if (ePressed) { ePressed = false; if (isLockFood == 0x0) { sendUint8(0x17); } } break; case 0x41: aPressed = false; break; case 0x53: sPressed = false; break; case 0x5a: if (zPressed) { zPressed = false; sendUint8(0x25); isGoldUsing = false; } break; case 0x58: if (xPressed) { xPressed = false; sendUint8(0x26); isGoldUsing = false; } break; case 0x46: microphone.stopRecord(); break; } }; const prog_cell = new function () { this.vertexShader = "\n\t\t#define PI 3.1415926538\n\n\t\tattribute float a_angle;// herbir noktanın(parçanın) açısı(aslında index değeri)\n\t\t//attribute float a_index;// noktanın kaçıncı nokta olduğu\n\t\tattribute vec2 a_texcoord;\n\n\t\tuniform int u_sliceCount;// çember dilim sayısı\n\t\tuniform vec2 u_canvasSize;\n\t\tuniform float u_size;// çember yarıçap\n\t\tuniform float u_scale;// zoom\n\t\tuniform vec2 u_translate;// kamera pozisyonu\n\t\tuniform vec2 u_position;// çember pozisyonu\n\t\tuniform int u_time;// new Date().getTime() ms olarak\n\t\t\n\t\t// fancyCell den gelen parametreler\n\t\tuniform int u_spikeMod;\n\t\tuniform float u_spikeSize;\n\n\t\tvarying vec2 v_texcoord;\n\t\t\n\t\tfloat mod2(float x, float y){\n\t\t\treturn x - y * floor(x/y);\n\t\t}\n\n\t\tvoid main(){\n\t\t\tfloat x;\n\t\t\tfloat y;\n\n\t\t\t/*\n\t\t\t * clip space için x ve y koordinatları [-1,1] aralığındadır,\n\t\t\t * yani origin tam ortadadır ve\n\t\t\t * genişlik ve yükseklik herzaman 2 birimdir\n\t\t\t */\n\t\t\tvec2 pixelScale = vec2(2.0)/u_canvasSize;\n\n\t\t\tif ( a_angle == 0.0 ){// ilk değer\n\t\t\t\tx = 0.0;\n\t\t\t\ty = 0.0;\n\t\t\t}else{\n\t\t\t\tfloat spike = 0.;\n\t\t\t\tif ( u_spikeMod!=0 && mod(a_angle, float(u_spikeMod))==0. ){\n\t\t\t\t\tspike = u_spikeSize;\n\t\t\t\t}\n\n\t\t\t\tfloat d = 1.0;\n\t\t\t\t//float d = 1.0+sin(a_angle)*0.05;\n\t\t\t\tfloat unitAngle = 2.0 * PI / float(u_sliceCount);\n\t\t\t\tfloat angle = a_angle;//+float(u_time)*.001;\n\t\t\t\tfloat size = u_size + spike;\n\t\t\t\tx = cos(angle * unitAngle)*d*pixelScale.x*size*u_scale;\n\t\t\t\ty = sin(angle * unitAngle)*d*pixelScale.y*size*u_scale;\n\t\t\t}\n\n\t\t\tx += (u_translate.x+u_position.x)*u_scale*pixelScale.x;\n\t\t\ty -= (u_translate.y+u_position.y)*u_scale*pixelScale.y;\n\n\t\t\tgl_Position = vec4(x, y, 0, 1);\n\n\t\t\tv_texcoord = a_texcoord*vec2(1,-1);\n\t\t}\n\t"; this.fragmentShader = "\n\t\tprecision mediump float;\n\n\t\tuniform int u_drawMode; // 0:renk, 1:texture\n\t\tuniform vec3 u_rgb;// renk\n\t\tuniform float u_alpha;\n\t\tuniform sampler2D u_texture; // hangi texture olduğu\n\n\t\tvarying vec2 v_texcoord;\n\n\t\t/*\n\t\t * gl_FragColor fragment shader da(burada) değer girilmelidir, vec4(r,g,b,a) değeri alır \n\t\t * gl_FragCoord.x = [0,canvas.width] sol kenar sağa doğru\n\t\t * gl_FragCoord.y = [0,canvas.height] alt kenar yukarı doğru\n\t\t */\n\t\tvoid main(){\n\t\t\tif ( u_drawMode==0 ){\n\t\t\t\tgl_FragColor = vec4(u_rgb, u_alpha);\n\t\t\t}else{\n\t\t\t\tgl_FragColor = vec4(texture2D(u_texture, v_texcoord).rgb, u_alpha);\n\t\t\t}\n\t\t}\n\t"; this.sliceCount = 0x40; this.program = null; this.buffer_radius = null; this.buffer_index = null; this.buffer_texCoord = null; this.loc_angle = null; this.loc_texcoord = null; this.loc_translate = null; this.loc_scale = null; this.loc_canvasSize = null; this.loc_position = null; this.loc_size = null; this.loc_sliceCount = null; this.loc_rgb = null; this.loc_drawMode = null; this.loc_spikeMod = null; this.loc_spikeSize = null; this.loc_alpha = null; this.DRAW_MODE_COLOR = 0x0; this.DRAW_MODE_TEXTURE = 0x1; this.init = function () { this.program = webgl.createProgramFromCode(this.vertexShader, this.fragmentShader); webgl.gl.useProgram(this.program); var _0x1e1dec = []; for (var _0x44d9b5 = 0x0; _0x44d9b5 < this.sliceCount + 0x2; _0x44d9b5++) { _0x1e1dec.push(_0x44d9b5); } this.buffer_radius = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.buffer_radius); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x1e1dec), webgl.gl.STATIC_DRAW); this.loc_angle = webgl.gl.getAttribLocation(this.program, "a_angle"); webgl.gl.vertexAttribPointer(this.loc_angle, 0x1, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_angle); var _0x1f62c4 = []; var _0x3a2180 = Math.PI * 0x2 / this.sliceCount; for (var _0x44d9b5 = 0x0; _0x44d9b5 < this.sliceCount + 0x2; _0x44d9b5++) { if (_0x44d9b5 == 0x0) { _0x1f62c4.push(0.5); _0x1f62c4.push(0.5); } else { var _0x4f3c3a = _0x44d9b5 * _0x3a2180; var _0xc724f2 = 0.5 + Math.cos(_0x4f3c3a) * 0.5; var _0x3e9998 = 0.5 + Math.sin(_0x4f3c3a) * 0.5; _0x1f62c4.push(_0xc724f2); _0x1f62c4.push(_0x3e9998); } } this.buffer_texCoord = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.buffer_texCoord); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x1f62c4), webgl.gl.STATIC_DRAW); this.loc_texcoord = webgl.gl.getAttribLocation(this.program, "a_texcoord"); webgl.gl.vertexAttribPointer(this.loc_texcoord, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_texcoord); var _0x305e57 = webgl.gl.getUniformLocation(this.program, "u_texture"); webgl.gl.uniform1i(_0x305e57, 0x0); this.loc_translate = webgl.gl.getUniformLocation(this.program, "u_translate"); this.loc_scale = webgl.gl.getUniformLocation(this.program, "u_scale"); this.loc_canvasSize = webgl.gl.getUniformLocation(this.program, 'u_canvasSize'); this.loc_position = webgl.gl.getUniformLocation(this.program, 'u_position'); this.loc_size = webgl.gl.getUniformLocation(this.program, 'u_size'); this.loc_sliceCount = webgl.gl.getUniformLocation(this.program, "u_sliceCount"); this.loc_rgb = webgl.gl.getUniformLocation(this.program, "u_rgb"); this.loc_drawMode = webgl.gl.getUniformLocation(this.program, "u_drawMode"); this.loc_spikeMod = webgl.gl.getUniformLocation(this.program, "u_spikeMod"); this.loc_spikeSize = webgl.gl.getUniformLocation(this.program, "u_spikeSize"); this.loc_alpha = webgl.gl.getUniformLocation(this.program, "u_alpha"); }; this["switch"] = function () { if (webgl.prog_last_switch == this) { return; } webgl.prog_last_switch = this; webgl.gl.useProgram(this.program); webgl.gl.enableVertexAttribArray(this.loc_angle); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.buffer_radius); webgl.gl.vertexAttribPointer(this.loc_angle, 0x1, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_texcoord); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.buffer_texCoord); webgl.gl.vertexAttribPointer(this.loc_texcoord, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); }; this.drawInit = function (_0x5b6e4c, _0x301ad6, _0x212739) { this['switch'](); webgl.gl.uniform2f(this.loc_translate, -cameraManager.translate_x_current, -cameraManager.translate_y_current); webgl.gl.uniform1f(this.loc_scale, cameraManager.scale); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform2f(this.loc_position, _0x5b6e4c.x_draw, _0x5b6e4c.y_draw); webgl.gl.uniform1f(this.loc_size, _0x5b6e4c.size_draw); webgl.gl.uniform1i(this.loc_sliceCount, this.sliceCount); webgl.gl.uniform3fv(this.loc_rgb, _0x5b6e4c.rgb_gl); webgl.gl.uniform1i(this.loc_drawMode, _0x301ad6); webgl.gl.uniform1f(this.loc_alpha, _0x212739); if (_0x5b6e4c.fancy != null) { webgl.gl.uniform1i(this.loc_spikeMod, _0x5b6e4c.fancy.spikeMod); webgl.gl.uniform1f(this.loc_spikeSize, _0x5b6e4c.fancy.spikeSize); } else { webgl.gl.uniform1i(this.loc_spikeMod, 0x0); webgl.gl.uniform1f(this.loc_spikeSize, 0x0); } }; this.draw = function (_0x331640, _0x3c08f6) { this.drawInit(_0x331640, _0x3c08f6, webgl.alpha); webgl.gl.drawArrays(webgl.gl.TRIANGLE_FAN, 0x0, this.sliceCount + 0x2); }; this.drawLine = function (_0xa7f0e4) { this.drawInit(_0xa7f0e4, this.DRAW_MODE_COLOR, 0x1); webgl.gl.uniform3fv(this.loc_rgb, ColorManager.Current_RGB_GL.CellBorder); webgl.gl.drawArrays(webgl.gl.LINE_STRIP, 0x1, this.sliceCount + 0x1); }; }(); const prog_font = new function () { this.vertexShader = "\n\tattribute vec2 a_vertex;\n\tattribute vec2 a_texcoord;\n\n\tuniform vec2 u_canvasSize;\n\tuniform float u_scale;// zoom\n\tuniform float u_size;// pixel olarak büyüklük\n\tuniform vec2 u_translate;// kamera pozisyonu\n\tuniform vec2 u_position;// yazı pozisyonu\n\n\t#define DRAWMODE_GAME\t0\n\t#define DRAWMODE_UI\t\t1\n\tuniform int u_drawMode;\n\n\tuniform float u_widthScale;// char width [0,1]\n\tuniform float u_heightScale;// char width [0,1]\n\tuniform float u_yoffsetScale;// [0,1]\n\n\tvarying vec2 v_texcoord;\n\n\tvoid main(){\n\t\tvec2 pixelScale = vec2(2.0)/u_canvasSize;\n\n\t\tvec2 p;\n\n\t\tp = a_vertex.xy * u_size;\n\t\tp.x *= u_widthScale;\n\t\tp.y *= u_heightScale;\n\n\t\tp.y += (1.0 - u_heightScale) * u_size;\n\t\tp.y -= u_yoffsetScale * u_size;\n\n\t\tif (u_drawMode==DRAWMODE_GAME){\n\t\t\tp.y -= u_size*.5;\n\t\t\tp += (u_translate + u_position)*vec2(1, -1);\n\n\t\t\tp *= u_scale;\n\t\t}else if ( u_drawMode==DRAWMODE_UI){\n\t\t\tp += u_position*vec2(1, -1) - u_canvasSize*vec2(0.5, -0.5);\n\t\t}\n\n\t\tp *= pixelScale;\n\n\t\tgl_Position = vec4(p.xy, 0, 1);\n\n\t\tv_texcoord = a_texcoord;//*vec2(1,-1);\n\t}\n\t"; this.fragmentShader = "\n\tprecision mediump float;\n\n\tuniform int u_drawMode;// 0:renk, 1:texture\n\tuniform vec3 u_rgb;// renk\n\tuniform float u_alpha;\n\tuniform sampler2D u_texture;// hangi texture\n\n\tvarying vec2 v_texcoord;\n\n\tvoid main(){\n\t\t//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n\t\tfloat r = texture2D(u_texture, v_texcoord).r;\n\t\tif ( r>0.0 ){\n\t\t\tgl_FragColor = vec4(r*u_rgb, r*u_alpha);\n\t\t}else{\n\t\t\tgl_FragColor = vec4(0);\n\t\t}\n\t}\n\t"; this.program = null; this.vertexBuffer = null; this.textureBuffer = null; this.fontTexture = []; this.fontMap = []; this.DRAWMODE_GAME = 0x0; this.DRAWMODE_UI = 0x1; this.info_size = 0x0; this.common_scaleW = 0x0; this.common_scaleH = 0x0; this.loc_vertex = null; this.loc_texcoord = null; this.loc_drawMode = null; this.loc_translate = null; this.loc_scale = null; this.loc_canvasSize = null; this.loc_size = null; this.loc_rgb = null; this.loc_alpha = null; this.loc_position = null; this.loc_widthScale = null; this.loc_heightScale = null; this.loc_yoffsetScale = null; this.drc = null; this.init = async function (_0x44b832) { this.drc = _0x44b832; this.program = webgl.createProgramFromCode(this.vertexShader, this.fragmentShader); webgl.gl.useProgram(this.program); this.loadFont(); this.loc_vertex = webgl.gl.getAttribLocation(this.program, "a_vertex"); this.loc_texcoord = webgl.gl.getAttribLocation(this.program, 'a_texcoord'); this.loc_drawMode = webgl.gl.getUniformLocation(this.program, 'u_drawMode'); this.loc_translate = webgl.gl.getUniformLocation(this.program, "u_translate"); this.loc_scale = webgl.gl.getUniformLocation(this.program, 'u_scale'); this.loc_canvasSize = webgl.gl.getUniformLocation(this.program, 'u_canvasSize'); this.loc_size = webgl.gl.getUniformLocation(this.program, "u_size"); this.loc_rgb = webgl.gl.getUniformLocation(this.program, "u_rgb"); this.loc_alpha = webgl.gl.getUniformLocation(this.program, "u_alpha"); this.loc_position = webgl.gl.getUniformLocation(this.program, "u_position"); this.loc_widthScale = webgl.gl.getUniformLocation(this.program, 'u_widthScale'); this.loc_heightScale = webgl.gl.getUniformLocation(this.program, "u_heightScale"); this.loc_yoffsetScale = webgl.gl.getUniformLocation(this.program, "u_yoffsetScale"); }; this.initFontVertex = function () { this.vertexBuffer = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); var _0x3c82df = []; for (var _0x4af15a = 0x0; _0x4af15a < this.fontMap.length; _0x4af15a++) { _0x3c82df.push(...[0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x1, 0x1]); } webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x3c82df), webgl.gl.STATIC_DRAW); var _0x1177bd = webgl.gl.getAttribLocation(this.program, "a_vertex"); webgl.gl.vertexAttribPointer(_0x1177bd, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(_0x1177bd); }; this.initFontTexture = function () { var _0x31f762 = []; var _0x1c5b3e = 0x0; for (var _0x5dd20f in this.fontMap) { let _0x362d27 = this.fontMap[_0x5dd20f]; _0x362d27.offset = _0x1c5b3e; _0x1c5b3e++; var _0xf7cd0b = _0x362d27.x / this.common_scaleW; var _0x35de37 = _0x362d27.y / this.common_scaleH; var _0x3174a3 = _0x362d27.width / this.common_scaleW; var _0x16cf1d = _0x362d27.height / this.common_scaleH; _0x31f762.push(...[_0xf7cd0b, _0x35de37 + _0x16cf1d, _0xf7cd0b, _0x35de37, _0xf7cd0b + _0x3174a3, _0x35de37 + _0x16cf1d, _0xf7cd0b + _0x3174a3, _0x35de37]); } this.textureBuffer = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.textureBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x31f762), webgl.gl.STATIC_DRAW); loc = webgl.gl.getAttribLocation(this.program, "a_texcoord"); webgl.gl.vertexAttribPointer(loc, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(loc); loc = webgl.gl.getUniformLocation(this.program, "u_texture"); webgl.gl.uniform1i(loc, 0x0); }; this.loadFont = async function () { var _0x27b1a3 = new XMLHttpRequest(); _0x27b1a3.onload = () => { this.loadInfoCommon(_0x27b1a3.responseXML); this.loadFontTexture(_0x27b1a3.responseXML); this.loadFontMap(_0x27b1a3.responseXML); this.initFontTexture(); this.initFontVertex(); }; _0x27b1a3.onerror = () => { console.log("Error while getting XML."); }; _0x27b1a3.open("GET", this.drc + 'index.fnt'); _0x27b1a3.responseType = "document"; _0x27b1a3.send(); }; this.loadInfoCommon = function (_0x4dbfdc) { var _0x1730a6 = _0x4dbfdc.querySelectorAll("info")[0x0]; var _0x4476ad = _0x4dbfdc.querySelectorAll('common')[0x0]; this.info_size = Math.abs(_0x1730a6.attributes.size.value); this.common_scaleW = Number(_0x4476ad.attributes.scaleW.value); this.common_scaleH = Number(_0x4476ad.attributes.scaleH.value); console.log("WebGL Font", _0x1730a6, _0x4476ad); }; this.loadFontMap = function (_0x317612) { var _0x531ce5 = _0x317612.querySelectorAll('char'); console.log("WebGL Karakter Sayısı", _0x531ce5.length); this.fontMap = []; for (var _0x368f3a of _0x531ce5) { var _0x766037 = _0x368f3a.getAttribute('id'); this.fontMap[_0x766037] = {}; for (const _0x55e3a9 of _0x368f3a.attributes) { this.fontMap[_0x766037][_0x55e3a9.name] = Number(_0x55e3a9.value); } this.fontMap[_0x766037].widthScale = this.fontMap[_0x766037].width / this.info_size; this.fontMap[_0x766037].heightScale = this.fontMap[_0x766037].height / this.info_size; this.fontMap[_0x766037].xoffsetScale = this.fontMap[_0x766037].xoffset / this.info_size; this.fontMap[_0x766037].yoffsetScale = this.fontMap[_0x766037].yoffset / this.info_size; this.fontMap[_0x766037].xadvanceScale = this.fontMap[_0x766037].xadvance / this.info_size; } }; this.loadFontTexture = function (_0x86139) { var _0x48aaaa = _0x86139.querySelectorAll("page"); this.fontTexture = []; for (var _0x2030a2 of _0x48aaaa) { var _0x389769 = _0x2030a2.getAttribute('id'); this.fontTexture[_0x389769] = {}; for (const _0x5680bd of _0x2030a2.attributes) { this.fontTexture[_0x389769][_0x5680bd.name] = _0x5680bd.value; } } for (var _0x5e2e36 of this.fontTexture) { _0x5e2e36.img = new Image(); _0x5e2e36.img.src = "//agarz.com" + this.drc + _0x5e2e36.file; _0x5e2e36.texture = null; _0x5e2e36.img.onload = function () { this.texture = webgl.gl.createTexture(); webgl.gl.bindTexture(webgl.gl.TEXTURE_2D, this.texture); webgl.gl.texImage2D(webgl.gl.TEXTURE_2D, 0x0, webgl.gl.RGBA, webgl.gl.RGBA, webgl.gl.UNSIGNED_BYTE, this.img); webgl.gl.texParameteri(webgl.gl.TEXTURE_2D, webgl.gl.TEXTURE_MIN_FILTER, webgl.gl.LINEAR); webgl.gl.texParameteri(webgl.gl.TEXTURE_2D, webgl.gl.TEXTURE_MAG_FILTER, webgl.gl.LINEAR); webgl.gl.generateMipmap(webgl.gl.TEXTURE_2D); }.bind(_0x5e2e36); } }; this["switch"] = function () { if (webgl.prog_last_switch == this) { return; } webgl.prog_last_switch = this; webgl.gl.useProgram(this.program); webgl.gl.enableVertexAttribArray(this.loc_vertex); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_texcoord); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.textureBuffer); webgl.gl.vertexAttribPointer(this.loc_texcoord, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); }; this.getTextWidth = function (_0x35541b) { if (this.fontMap.length == 0x0) { return 0x0; } let _0x297340 = 0x0; for (var _0x1da7ef = 0x0; _0x1da7ef < _0x35541b.length; _0x1da7ef++) { let _0x18c362 = _0x35541b.charCodeAt(_0x1da7ef); if (_0x18c362 == 'undefined' || _0x18c362 == null) {} let _0x2e8d45 = this.fontMap[_0x18c362]; if (_0x2e8d45 == null) { continue; } _0x297340 += _0x2e8d45.xadvanceScale; } return _0x297340; }; this.getCenterX = function (_0x65a097, _0x3b5b52) { let _0x2a675e = this.getTextWidth(_0x65a097) * _0x3b5b52; let _0x11e278 = (webgl.gl.canvas.width - _0x2a675e) * 0.5; return _0x11e278; }; this.drawGame = function (_0x31ec58, _0x3d3a20, _0x25e4fe, _0x18abba, _0x5701ec, _0x504eb4) { if (this.fontTexture.length == 0x0) { return; } this["switch"](); webgl.gl.uniform1i(this.loc_drawMode, this.DRAWMODE_GAME); webgl.gl.uniform2f(this.loc_translate, -cameraManager.translate_x_current, -cameraManager.translate_y_current); webgl.gl.uniform1f(this.loc_scale, cameraManager.scale); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform1f(this.loc_size, _0x5701ec); webgl.gl.uniform3fv(this.loc_rgb, _0x25e4fe); webgl.gl.uniform1f(this.loc_alpha, _0x18abba); _0x31ec58 -= this.getTextWidth(_0x504eb4) * 0.5 * _0x5701ec; _0x3d3a20 -= 0.5 * _0x5701ec; for (var _0x4e751f = 0x0; _0x4e751f < _0x504eb4.length; _0x4e751f++) { let _0x4b97d7 = _0x504eb4.charCodeAt(_0x4e751f); let _0x1048f1 = this.fontMap[_0x4b97d7]; if (_0x1048f1 == null) { continue; } webgl.gl.uniform2f(this.loc_position, _0x31ec58, _0x3d3a20); webgl.gl.uniform1f(this.loc_widthScale, _0x1048f1.widthScale); webgl.gl.uniform1f(this.loc_heightScale, _0x1048f1.heightScale); webgl.gl.uniform1f(this.loc_yoffsetScale, _0x1048f1.yoffsetScale); webgl.gl.bindTexture(webgl.gl.TEXTURE_2D, this.fontTexture[_0x1048f1.page].texture); webgl.gl.drawArrays(webgl.gl.TRIANGLE_STRIP, _0x1048f1.offset * 0x4, 0x4); _0x31ec58 += _0x5701ec * _0x1048f1.xadvanceScale; } }; this.drawUI = function (_0x52828a, _0x38b67a, _0x112dc0, _0x46f344, _0x13d7ee, _0x3b5dfd) { if (this.fontTexture.length == 0x0) { return; } this["switch"](); webgl.gl.uniform1i(this.loc_drawMode, this.DRAWMODE_UI); webgl.gl.uniform2f(this.loc_translate, -cameraManager.translate_x_current, -cameraManager.translate_y_current); webgl.gl.uniform1f(this.loc_scale, cameraManager.scale); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform1f(this.loc_size, _0x13d7ee); webgl.gl.uniform3fv(this.loc_rgb, _0x112dc0); webgl.gl.uniform1f(this.loc_alpha, _0x46f344); var _0x1462c9 = 0x0; for (var _0x2f75d1 = 0x0; _0x2f75d1 < _0x3b5dfd.length; _0x2f75d1++) { let _0x24e114 = _0x3b5dfd.charCodeAt(_0x2f75d1); let _0x3ccc96 = this.fontMap[_0x24e114]; if (_0x3ccc96 == null) { continue; } webgl.gl.uniform2f(this.loc_position, _0x52828a, _0x38b67a); webgl.gl.uniform1f(this.loc_widthScale, _0x3ccc96.widthScale); webgl.gl.uniform1f(this.loc_heightScale, _0x3ccc96.heightScale); webgl.gl.uniform1f(this.loc_yoffsetScale, _0x3ccc96.yoffsetScale); webgl.gl.bindTexture(webgl.gl.TEXTURE_2D, this.fontTexture[_0x3ccc96.page].texture); webgl.gl.drawArrays(webgl.gl.TRIANGLE_STRIP, _0x3ccc96.offset * 0x4, 0x4); let _0x5f4647 = _0x13d7ee * _0x3ccc96.xadvanceScale; _0x52828a += _0x5f4647; _0x1462c9 += _0x5f4647; } return _0x1462c9; }; }(); const prog_rect = new function () { this.vertexShader = "\n\tattribute vec2 a_vertex;\n\n\tuniform vec2 u_canvasSize;\n\tuniform vec2 u_position;// yazı pozisyonu\n\tuniform vec2 u_size;\n\t\n\tvoid main(){\n\t\tvec2 pixelScale = vec2(2.0)/u_canvasSize;\n\n\t\tvec2 p = a_vertex.xy * u_size * vec2(1, -1);\n\t\t\n\t\tp += u_position*vec2(1, -1) - u_canvasSize*vec2(0.5, -0.5);\n\n\t\tp *= pixelScale;\n\t\tgl_Position = vec4(p.xy, 0, 1);\n\t}\n\t"; this.fragmentShader = "\n\tprecision mediump float;\n\n\tuniform vec3 u_rgb;\n\tuniform float u_alpha;\n\n\tvoid main(){\n\t\tgl_FragColor = vec4(u_rgb, u_alpha);\n\t}"; this.program = null; this.vertexBuffer = null; this.loc_vertex = null; this.loc_canvasSize = null; this.loc_position = null; this.size = null; this.rgb = null; this.alpha = null; this.init = function () { this.program = webgl.createProgramFromCode(this.vertexShader, this.fragmentShader); webgl.gl.useProgram(this.program); var _0xb6cbc5 = [0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x1, 0x1]; this.vertexBuffer = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0xb6cbc5), webgl.gl.STATIC_DRAW); this.loc_vertex = webgl.gl.getAttribLocation(this.program, 'a_vertex'); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_vertex); this.loc_canvasSize = webgl.gl.getUniformLocation(this.program, "u_canvasSize"); this.loc_position = webgl.gl.getUniformLocation(this.program, "u_position"); this.size = webgl.gl.getUniformLocation(this.program, "u_size"); this.rgb = webgl.gl.getUniformLocation(this.program, 'u_rgb'); this.alpha = webgl.gl.getUniformLocation(this.program, "u_alpha"); }; this["switch"] = function () { if (webgl.prog_last_switch == this) { return; } webgl.prog_last_switch = this; webgl.gl.useProgram(this.program); webgl.gl.enableVertexAttribArray(this.loc_vertex); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); }; this.draw = function (_0x3d0d2c, _0x58cb36, _0xc1c0e6, _0x964197, _0x1cb344, _0x61462f) { this["switch"](); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform2f(this.loc_position, _0x3d0d2c, _0x58cb36); webgl.gl.uniform2f(this.size, _0xc1c0e6, _0x964197); webgl.gl.uniform3fv(this.rgb, _0x1cb344); webgl.gl.uniform1f(this.alpha, _0x61462f); webgl.gl.drawArrays(webgl.gl.TRIANGLE_STRIP, 0x0, 0x4); }; }(); const prog_rectT = new function () { this.vertexShader = "\n\tattribute vec2 a_vertex;\n\tattribute vec2 a_texcoord;\n\n\tuniform vec2 u_canvasSize;\n\tuniform vec2 u_position;// yazı pozisyonu\n\tuniform vec2 u_size;\n\tuniform int u_bottomToTop;\n\tuniform int u_rightToLeft;\n\n\tvarying vec2 v_texcoord;\n\t\n\tvoid main(){\n\t\tvec2 pixelScale = vec2(2.0)/u_canvasSize;\n\n\t\tvec2 p = a_vertex.xy * u_size * vec2(1, -1);\n\t\t\n\t\tif ( u_bottomToTop==1 ){\n\t\t\tp.y += u_position.y - u_canvasSize.y*.5;\n\t\t}else{\n\t\t\tp.y += -u_position.y + u_canvasSize.y*.5;\n\t\t}\n\n\t\tif ( u_rightToLeft==1 ){\n\t\t\tp.x += -u_position.x + u_canvasSize.x*.5;\n\t\t}else{\n\t\t\tp.x += u_position.x - u_canvasSize.x*.5;\n\t\t}\n\n\t\tp *= pixelScale;\n\t\tgl_Position = vec4(p.xy, 0, 1);\n\n\t\tv_texcoord = a_texcoord;\n\t}\n\t"; this.fragmentShader = "\n\tprecision mediump float;\n\n\tuniform sampler2D u_texture;\n\n\tvarying vec2 v_texcoord;\n\n\tvoid main(){\n\t\tgl_FragColor = texture2D(u_texture, v_texcoord);\n\t}"; this.program = null; this.vertexBuffer = null; this.textureBuffer = null; this.loc_vertex = null; this.loc_texcoord = null; this.loc_canvasSize = null; this.loc_position = null; this.loc_texture = null; this.loc_size = null; this.init = function () { this.program = webgl.createProgramFromCode(this.vertexShader, this.fragmentShader); webgl.gl.useProgram(this.program); var _0x2920ab = [0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x1, 0x1]; var _0xff1e07 = [0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x1, 0x1]; this.vertexBuffer = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x2920ab), webgl.gl.STATIC_DRAW); this.loc_vertex = webgl.gl.getAttribLocation(this.program, "a_vertex"); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_vertex); this.textureBuffer = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.textureBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0xff1e07), webgl.gl.STATIC_DRAW); this.loc_texcoord = webgl.gl.getAttribLocation(this.program, "a_texcoord"); webgl.gl.vertexAttribPointer(this.loc_texcoord, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_texcoord); this.loc_canvasSize = webgl.gl.getUniformLocation(this.program, "u_canvasSize"); this.loc_position = webgl.gl.getUniformLocation(this.program, "u_position"); this.loc_size = webgl.gl.getUniformLocation(this.program, "u_size"); this.loc_bottomToTop = webgl.gl.getUniformLocation(this.program, "u_bottomToTop"); this.loc_rightToLeft = webgl.gl.getUniformLocation(this.program, 'u_rightToLeft'); }; this["switch"] = function () { if (webgl.prog_last_switch == this) { return; } webgl.prog_last_switch = this; webgl.gl.useProgram(this.program); webgl.gl.enableVertexAttribArray(this.loc_vertex); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_texcoord); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.textureBuffer); webgl.gl.vertexAttribPointer(this.loc_texcoord, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); }; this.draw = function (_0x2ffd91, _0x11b674, _0x503b8a, _0x2cec02, _0x244df2, _0xe479d9) { this['switch'](); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform2f(this.loc_position, _0x2ffd91, _0x11b674); webgl.gl.uniform2f(this.loc_size, _0x503b8a, _0x2cec02); webgl.gl.uniform1i(this.loc_bottomToTop, _0x244df2); webgl.gl.uniform1i(this.loc_rightToLeft, _0xe479d9); webgl.gl.drawArrays(webgl.gl.TRIANGLE_STRIP, 0x0, 0x4); }; }(); const prog_line = new function () { this.vertexShader = "\n\tattribute vec2 a_vertex;\n\n\tuniform vec2 u_canvasSize;\n\tuniform float u_scale;// zoom\n\tuniform vec2 u_translate;// kamera pozisyonu\n\tuniform vec2 u_position;\n\t\n\tvoid main(){\n\t\tvec2 pixelScale = vec2(2.0)/u_canvasSize;\n\n\t\tvec2 p = u_translate + u_position + a_vertex;\n\n\t\tp *= pixelScale * u_scale * vec2(1, -1);\n\n\t\tgl_Position = vec4(p.xy, 0, 1);\n\t}\n\t"; this.fragmentShader = "\n\tprecision mediump float;\n\n\tuniform vec3 u_rgb;\n\n\tvoid main(){\n\t\tgl_FragColor = vec4(u_rgb, 1.);\n\t}"; this.program = null; this.vertexBuffer = null; this.loc_vertex = null; this.loc_canvasSize = null; this.loc_position = null; this.loc_scale = null; this.loc_translate = null; this.loc_rgb = null; this.init = function () { this.program = webgl.createProgramFromCode(this.vertexShader, this.fragmentShader); webgl.gl.useProgram(this.program); var _0x577765 = [0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x1, 0x1]; this.vertexBuffer = webgl.gl.createBuffer(); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x577765), webgl.gl.STATIC_DRAW); this.loc_vertex = webgl.gl.getAttribLocation(this.program, "a_vertex"); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_vertex); this.loc_canvasSize = webgl.gl.getUniformLocation(this.program, "u_canvasSize"); this.loc_position = webgl.gl.getUniformLocation(this.program, "u_position"); this.loc_scale = webgl.gl.getUniformLocation(this.program, "u_scale"); this.loc_translate = webgl.gl.getUniformLocation(this.program, 'u_translate'); this.loc_rgb = webgl.gl.getUniformLocation(this.program, "u_rgb"); }; this["switch"] = function () { if (webgl.prog_last_switch == this) { return; } webgl.prog_last_switch = this; webgl.gl.useProgram(this.program); webgl.gl.enableVertexAttribArray(this.loc_vertex); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); }; this.draw = function (_0x579e81, _0x7d1901, _0x3ea20d, _0x364fd5, _0x1b1337) { this["switch"](); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x3ea20d), webgl.gl.STATIC_DRAW); webgl.gl.uniform2f(this.loc_translate, -cameraManager.translate_x_current, -cameraManager.translate_y_current); webgl.gl.uniform1f(this.loc_scale, cameraManager.scale); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform2f(this.loc_position, _0x579e81, _0x7d1901); webgl.gl.uniform3fv(this.loc_rgb, _0x1b1337); let _0x3a95b6 = _0x3ea20d.length / 0x2; var _0x1fe042; if (_0x364fd5) { _0x1fe042 = webgl.gl.LINE_STRIP; } else { _0x1fe042 = webgl.gl.LINES; } webgl.gl.drawArrays(_0x1fe042, 0x0, _0x3a95b6); }; }(); const prog_background = new function () { this.vertexShader = "\n\tattribute vec2 a_vertex;\n\n\tuniform vec2 u_canvasSize;\n\tuniform float u_scale;// zoom\n\tuniform vec2 u_translate;// kamera pozisyonu\n\t\n\tvoid main(){\n\t\tvec2 pixelScale = vec2(2.0)/u_canvasSize;\n\n\t\tvec2 p = a_vertex.xy * vec2(1, -1)*u_scale;\n\t\t\n\t\t//p -= u_canvasSize*vec2(0.5, -0.5);\n\n\t\tp.x += u_translate.x*u_scale;\n\t\tp.y -= u_translate.y*u_scale;\n\n\t\tp *= pixelScale;\n\t\tgl_Position = vec4(p.xy, 0, 1);\n\t}\n\t"; this.fragmentShader = "\n\tprecision mediump float;\n\n\tuniform vec4 u_rgba;\n\n\tvoid main(){\n\t\tgl_FragColor = u_rgba;\n\t}"; this.program = null; this.vertexBuffer = null; this.gridLineCount = 0x0; this.loc_vertex = null; this.loc_translate = null; this.loc_scale = null; this.loc_canvasSize = null; this.loc_rgba = null; this.initProgram = function () { this.program = webgl.createProgramFromCode(this.vertexShader, this.fragmentShader); webgl.gl.useProgram(this.program); }; this.initBuffer = function () { var _0x369e4b = [leftPos, topPos, rightPos, topPos, rightPos, bottomPos, leftPos, bottomPos]; this.gridLineCount = 0x0; for (var _0x4f4aab = leftPos + 0x64; _0x4f4aab <= rightPos; _0x4f4aab += 0x64) { this.gridLineCount++; _0x369e4b.push(...[_0x4f4aab, topPos, _0x4f4aab, bottomPos]); } for (var _0x4da8aa = topPos + 0x64; _0x4da8aa <= bottomPos; _0x4da8aa += 0x64) { this.gridLineCount++; _0x369e4b.push(...[leftPos, _0x4da8aa, rightPos, _0x4da8aa]); } if (this.vertexBuffer == null) { this.vertexBuffer = webgl.gl.createBuffer(); } webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.bufferData(webgl.gl.ARRAY_BUFFER, new Float32Array(_0x369e4b), webgl.gl.STATIC_DRAW); this.loc_vertex = webgl.gl.getAttribLocation(this.program, "a_vertex"); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); webgl.gl.enableVertexAttribArray(this.loc_vertex); this.loc_translate = webgl.gl.getUniformLocation(this.program, 'u_translate'); this.loc_scale = webgl.gl.getUniformLocation(this.program, 'u_scale'); this.loc_canvasSize = webgl.gl.getUniformLocation(this.program, 'u_canvasSize'); this.loc_rgba = webgl.gl.getUniformLocation(this.program, "u_rgba"); }; this['switch'] = function () { if (webgl.prog_last_switch == this) { return; } webgl.prog_last_switch = this; webgl.gl.useProgram(this.program); webgl.gl.enableVertexAttribArray(this.loc_vertex); webgl.gl.bindBuffer(webgl.gl.ARRAY_BUFFER, this.vertexBuffer); webgl.gl.vertexAttribPointer(this.loc_vertex, 0x2, webgl.gl.FLOAT, false, 0x0, 0x0); }; this.draw = function () { if (this.program == null || this.vertexBuffer == null) { return; } this["switch"](); webgl.gl.uniform2f(this.loc_translate, -cameraManager.translate_x_current, -cameraManager.translate_y_current); webgl.gl.uniform1f(this.loc_scale, cameraManager.scale); webgl.gl.uniform2f(this.loc_canvasSize, webgl.gl.canvas.width, webgl.gl.canvas.height); webgl.gl.uniform4fv(this.loc_rgba, [0x0, cameraManager.scale, 0x0, cameraManager.scale]); webgl.gl.drawArrays(webgl.gl.LINES, 0x4, this.gridLineCount * 0x2); webgl.gl.uniform4fv(this.loc_rgba, [cameraManager.scale * 0x32, 0x0, 0x0, 0x1]); webgl.gl.drawArrays(webgl.gl.LINE_LOOP, 0x0, 0x4); }; }(); async function document_ready() { options.init(); options.addYesNoSetting(trans[0x157], 'showSkin', true, null); options.addYesNoSetting(trans[0x156], 'showName', true, null); if (!isMobile) { options.addYesNoSetting(trans[0x6], 'showDarkTheme', true, function () { ColorManager.UpdateCurrent(); }); } else { options.set("showDarkTheme", true); } ColorManager.UpdateCurrent(); options.addYesNoSetting(trans[0xe], "transparentRender", true, null); options.addYesNoSetting(trans[0xf], 'showScore', true, null); options.addYesNoSetting(trans[0x4a], 'simpleGreen', true, null); options.addYesNoSetting("Makro", "macro", true, null); options.addYesNoSetting(trans[0x101], 'scopeAround', true, null); options.addYesNoSetting(trans[0x112], "showInfo", true, null); if (!isMobile) { options.addYesNoSetting(trans[0x8], "hideChat", false, function () { if (options.get("hideChat")) { $(DIV_CHAT).hide(); } else { $(DIV_CHAT).show(); } }); } options.addYesNoSetting(trans[0x12c], "drawEdge", true, null); options.addYesNoSetting(trans[0xb5], "showClanName", true, null); options.addYesNoSetting(trans[0x12f], 'quickSplit', false, null); options.addYesNoSetting(trans[0x142], "accNoShow", true, null); if (isMobile) { options.addYesNoSetting(trans[0x158], 'fullScreen', true, null); } else { options.addYesNoSetting(trans[0x158], "fullScreen", false, null); } options.addYesNoSetting('GL', "webgl", false, function () { if (options.get("webgl")) { renderMode = 0x2; $('#canvas').hide(); $("#canvas_gl").show(); } else { renderMode = 0x1; $("#canvas").show(); $("#canvas_gl").hide(); } }); if (isMobile) { chatFilter = document.getElementById('chatFilter_mobile'); $('#settings').hide(); $('#idSolMenu').hide(); $("#settingsPopup_close").click(function () { $("#overlays").show(); $("#settingsPopup").hide(); }); $("#solMenuPopup_close").click(function () { $("#overlays").show(); $("#solMenuPopup").hide(); }); $("#mobilTools_options").click(function () { $("#overlays").hide(); $('#settingsPopup').show(); }); $("#mobilTools_solMenu").click(function () { $("#overlays").hide(); $('#solMenuPopup').show(); }); $('#imgBanner').attr("src", "banner-white.png"); } else { chatFilter = document.getElementById("chatFilter"); $("#settingsPopup").hide(); $('#mobilTools').hide(); } $('#bottomContainer_desktop').hide(); $("#bottomContainer_mobile").hide(); if (!isMobile) { DIV_CHAT = '#bottomContainer_desktop'; $(DIV_CHAT).show(); $(document).keypress(function (_0x4dde3a) { if (_0x4dde3a.which == 0xd) { $("#chat_textbox").focus(); } }); } else { DIV_CHAT = "#bottomContainer_mobile"; $(DIV_CHAT).hide(); $('#closeChatContainer').mousedown(function () { sb.chatShow.setShow(false); }); $("#sendChatButton").click(function () { sendChatMessage(); }); $("#helloDialog").css('background-color', "#000C"); $("#helloDialog").css("border", "1px solid #FFF"); } if (isMobile) { yesno_settings = document.getElementById("yesno_settings_mobile"); } else { yesno_settings = document.getElementById("yesno_settings"); } if (localStorage.chatMode == null) { setChatMode(0x0, 3); } else { setChatMode(Number(localStorage.chatMode), 0x1); } mainCanvas = document.getElementById('canvas'); mainCanvas.focus(); ctx = mainCanvas.getContext('2d'); webgl.init(); sb = buttonsInit(); mainCanvas.onmousedown = mainCanvas_onmousedown; mainCanvas.onmousemove = mainCanvas_onmousemove; if (isTouchDevice) { mainCanvas.addEventListener('touchstart', onTouchStart, false); mainCanvas.addEventListener("touchmove", onTouchMove, false); mainCanvas.addEventListener('touchend', onTouchEnd, false); } document.body.onmousewheel = body_onmousewheel; mainCanvas.onfocus = function () { isTyping = false; }; if (document.getElementById("chat_textbox")) { document.getElementById("chat_textbox").onblur = function () { isTyping = false; }; } if (document.getElementById("chat_textbox")) { document.getElementById("chat_textbox").onfocus = function () { isTyping = true; }; } window.onblur = function () { wPressed = qPressed = spacePressed = false; }; window.onresize = canvasResize; canvasResize(); if (window.requestAnimationFrame) { window.requestAnimationFrame(redrawGameScene); } else { setInterval(drawGameScene, 16.666666666666668); } document.getElementById("overlays").style.display = "block"; canvasResize(); $('#enterPriceYes').click(function () { document.getElementById("enterPriceConfirmDialog").style.display = "none"; sendConfirmPay(); }); $("#enterPriceNo").click(function () { document.getElementById("enterPriceConfirmDialog").style.display = "none"; document.getElementById("overlays").style.display = "block"; }); $("#versionWrongDialog_ok").click(function () { document.getElementById("versionWrongDialog").style.display = "none"; document.getElementById("overlays").style.display = "block"; }); $('#generalErrorDialog_ok').click(function () { document.getElementById("generalErrorDialog").style.display = "none"; document.getElementById("overlays").style.display = "block"; }); $("#finalLeaderboardDialog_ok").click(function () { document.getElementById("finalLeaderboardDialog").style.display = 'none'; document.getElementById("overlays").style.display = "block"; }); $("#replayBtn").click(function () { cellManager.recordN = 0x0; cellManager.drawMode = 0x1; $("#overlays").hide(); }); $("#showMessageOk").click(function () { $("#showMessageOverlays").hide(); $("#overlays").show(); }); microphone.initHtml(); adminChatMenu2.init(); if (isMobile) { loginDivName = "#idUserMobile"; document.getElementById("idUyari").style.display = 'none'; document.getElementById("idTwitch").style.display = "none"; document.getElementById("idYayin").style.display = 'none'; document.getElementById("idGooglePlay").style.display = "none"; document.getElementById('idDiscord').style.display = "none"; document.getElementById("idUserContainer").style.display = "none"; document.getElementById("instructions").style.display = 'none'; } else { document.getElementById("idUserMobile").style.display = "none"; loginDivName = '#idUserDesktop'; } if (localStorage.getItem("userToken") === null || localStorage.userToken == "null") { user_show(); ajax_skinFavori(); } else { user_token(); } $('#divReport').hide(); $("#reportKapat").click(function () { $("#divReport").hide(); }); } function body_onmousewheel(_0x4ff649) { cameraManager.onMouseWheel(_0x4ff649.wheelDelta); tutorial_zoom.onMouseWheel(); } function wsClose() { try { playerInfoList = []; ws.close(); } catch (_0x2029db) {} ws = null; } function wsConnect() { cellManager.clearActive(); cellManager.clearRecord(); leaderBoard = []; leaderboard_ext = []; lastWinner = '?'; topMessage1 = ''; topMessage2 = ''; topMessage3 = ''; countdown = 0xe10; userScoreMax = 0x0; userScoreCurrent = 0x0; teamMapPlayers = []; clanMapPlayers = []; goldToPrizeTime = 0x0; autoBigTime = 0x0; ws = new WebSocket(ws_url); ws.binaryType = "arraybuffer"; ws.onopen = onWsOpen; ws.onmessage = onWsMessage; ws.onclose = onWsClose; ws.onerror = function (_0x52124e) { console.log("socket error", _0x52124e); }; wsList.push(ws); } function wsSend(_0x115723) { if (ws != null) { ws.send(_0x115723.buffer); } else { console.log("wsSend ws==null"); } } function sendStart() { if (0x2710 == serverVersion) { cameraManager.onSendStart(); sendLang(); if (localStorage.userToken != null && localStorage.userToken.length == 0x20) { var _0x8fddc = prepareData(65); _0x8fddc.setUint8(0x0, 0x3); var _0x45191c = 0x1; for (var _0xc432c0 = 0x0; _0xc432c0 < 0x20; ++_0xc432c0) { var _0xe1904d = localStorage.userToken.charCodeAt(_0xc432c0); _0x8fddc.setUint16(_0x45191c, _0xe1904d, true); _0x45191c += 0x2; } wsSend(_0x8fddc); } else if (playMode == 0x2) { spectatorId = -0x1; spectatorPlayer = null; if (typeof isAdmin !== "undefined") { sendAdminSpectate(); } else { sendUint8(0x1); } } else { sendUint8(0x8); } } else if (serverVersion != 0x0) { showGeneralError(trans[0x10a], "C:10000 S:" + serverVersion); } } function sendLang() { var _0x22ad35 = prepareData(0x2); _0x22ad35.setUint8(0x0, 0x19); switch (getLangCode()) { case 'tr': _0x22ad35.setUint8(0x1, 0x1); break; case 'en': _0x22ad35.setUint8(0x1, 0x2); break; case 'es': _0x22ad35.setUint8(0x1, 0x3); break; case 'de': _0x22ad35.setUint8(0x1, 0x4); break; case 'ru': _0x22ad35.setUint8(0x1, 0x5); break; } wsSend(_0x22ad35); } function onWsOpen() { var _0x5499fe = prepareData(0x5); _0x5499fe.setUint8(0x0, 0xff); _0x5499fe.setUint32(0x1, 0x2710, true); wsSend(_0x5499fe); } function setSpectator(_0x2ebb2f) { var _0x939c65 = prepareData(0x5); _0x939c65.setUint8(0x0, 0x32); _0x939c65.setUint32(0x1, _0x2ebb2f); wsSend(_0x939c65); } function onWsClose() { ws = null; chatManager.clear(); if (skipPopupOnClose == true) { skipPopupOnClose = false; } else if ($("#finalLeaderboardDialog").is(":visible") == false && cellManager.drawMode == 0x0) { document.getElementById("overlays").style.display = 'block'; canvasResize(); } playerId = -0x1; spectatorId = -0x1; if (reconnect == 0x0) { playMode = 0x0; } else { reconnect = 0x0; wsConnect(); } } function onWsMessage(_0x1b85b1) { try { handleWsMessage(new DataView(_0x1b85b1.data)); } catch (_0xe517e9) { console.log(_0xe517e9); } } function transLastWinner(_0x5ad5dd, _0x2ae2a2, _0x5cc894) { switch (getLangCode()) { case 'tr': return _0x5ad5dd + " KAZANAN " + _0x5cc894 + " SKOR " + _0x2ae2a2.dotFormat(); case 'en': return _0x5ad5dd + " WINNER IS " + _0x5cc894 + " SCORE " + _0x2ae2a2.dotFormat(); case 'es': return _0x5ad5dd + " GANADOR ES " + _0x5cc894 + " PUNTUACIÓN " + _0x2ae2a2.dotFormat(); case 'de': return _0x5ad5dd + " GEWINNER " + _0x5cc894 + " ERGEBNIS " + _0x2ae2a2.dotFormat(); } return "err lang code!"; } function transNewRecord(_0x4edaff, _0x318836, _0x3606e0) { switch (getLangCode()) { case 'tr': return _0x4edaff + " REKOR! " + _0x3606e0 + " SKOR " + _0x318836.dotFormat(); case 'en': return _0x4edaff + " NEW RECORD! " + _0x3606e0 + " SCORE " + _0x318836.dotFormat(); case 'es': return _0x4edaff + " NEUVO RECORD! " + _0x3606e0 + " PUNTUACIÓN " + _0x318836.dotFormat(); case 'de': return _0x4edaff + " NEUER EINTRAG! " + _0x3606e0 + " ERGEBNIS " + _0x318836.dotFormat(); } return "err lang code!"; } function transWinClanWar(_0x49018d, _0x4df253, _0x52dc07) { switch (getLangCode()) { case 'tr': return _0x49018d + " KLAN SAVAŞINI '" + _0x52dc07 + "' KAZANDI! ÖDÜL:" + _0x4df253.dotFormat() + " BONUS GOLD!"; case 'en': return _0x49018d + " CLAN WAR WINNER IS '" + _0x52dc07 + "'! PRIZE:" + _0x4df253.dotFormat() + " BONUS GOLD!"; case 'es': return _0x49018d + " CLAN WAR WINNER IS '" + _0x52dc07 + "'! PRIZE:" + _0x4df253.dotFormat() + " BONUS GOLD!"; case 'de': return _0x49018d + " CLAN WAR WINNER IS '" + _0x52dc07 + "'! PRIZE:" + _0x4df253.dotFormat() + " BONUS GOLD!"; } return "err lang code!"; } function transMessage(_0x3af496) { if (_0x3af496.startsWith("trans ")) { var _0x29a88b = _0x3af496.substring(0x6); var _0x1175bb = _0x29a88b.split(','); if (_0x1175bb[0x0] == '1') { var _0x2d9ad0 = _0x1175bb[0x1]; var _0x157b23 = parseInt(_0x1175bb[0x2]); var _0x5bf9e7 = _0x1175bb.slice(0x3).join(" "); return transLastWinner(_0x2d9ad0, _0x157b23, _0x5bf9e7); } else { if (_0x1175bb[0x0] == '2') { var _0x2d9ad0 = _0x1175bb[0x1]; var _0x157b23 = parseInt(_0x1175bb[0x2]); var _0x5bf9e7 = _0x1175bb.slice(0x3).join(" "); return transNewRecord(_0x2d9ad0, _0x157b23, _0x5bf9e7); } else { if (_0x1175bb[0x0] == '3') { var _0x2d9ad0 = _0x1175bb[0x1]; var _0x3be3b9 = parseInt(_0x1175bb[0x2]); var _0xca7e = _0x1175bb.slice(0x3).join(" "); return transWinClanWar(_0x2d9ad0, _0x3be3b9, _0xca7e); } else { return _0x3af496; } } } } else { return _0x3af496; } } function handleWsMessage(_0x3bf81) { function _0x12ca31() { var _0x20362f = ''; var _0x264b0e; while ((_0x264b0e = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; _0x20362f += String.fromCharCode(_0x264b0e); } _0xfbf61 += 0x2; return _0x20362f; } var _0xfbf61 = 0x0; var _0x555427 = _0x3bf81.getUint8(_0xfbf61); _0xfbf61 += 0x1; switch (_0x555427) { case 0x1: break; case 0x11: var _0xc8d50f = _0x3bf81.getFloat32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x466cf1 = _0x3bf81.getFloat32(_0xfbf61, true); _0xfbf61 += 0x4; _0xfbf61 += 0x4; cameraManager.translate_x = _0xc8d50f; cameraManager.translate_y = _0x466cf1; cameraManager.translate_x_current = _0xc8d50f; cameraManager.translate_y_current = _0x466cf1; break; case 0x15: _0xfbf61 += 0x2; _0xfbf61 += 0x2; break; case 0x20: var _0xf6d554 = _0x3bf81.getUint32(_0xfbf61, true); cellManager.playerCellIdList.push(_0xf6d554); _0xfbf61 += 0x4; break; case 0x31: noRanking = false; var _0x17d305 = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; leaderBoard = []; for (_0x13f2f6 = 0x0; _0x13f2f6 < _0x17d305; ++_0x13f2f6) { var _0x5c948f = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; leaderBoard.push({ 'id': _0x5c948f, 'name': _0x12ca31(), 'draw_x': 0x0, 'draw_y': 0x0, 'draw_w': 0x0, 'draw_h': 0x0 }); } break; case 0x33: leaderboard_ext = []; var _0x1304fd = _0x3bf81.getUint8(_0xfbf61, true); _0xfbf61 += 0x1; for (var _0x13f2f6 = 0x0; _0x13f2f6 < _0x1304fd; ++_0x13f2f6) { var _0x5789ab = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x1ffaed = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x49714e = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x303ae5 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x5bcd78 = _0x3bf81.getUint8(_0xfbf61, true); _0xfbf61 += 0x1; var _0x9bfefc = 0x0; var _0x3c15fb = 0x0; if ((_0x5bcd78 & 0x1) == 0x1) { _0x9bfefc = 0x1; } if ((_0x5bcd78 & 0x2) == 0x2) { _0x3c15fb = 0x1; } leaderboard_ext.push({ 'pID': _0x5789ab, 'x': _0x1ffaed, 'y': _0x49714e, 'i': _0x303ae5, 'sameClan': _0x9bfefc, 'sameTeam': _0x3c15fb }); } break; case 0x34: leaderboard_ext = []; var _0x2b3b13 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x13f2f6 = 0x0; plList = []; while (_0x13f2f6 < _0x2b3b13) { var _0x39e33f = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x107717 = ''; for (var _0x272443 = 0x0; _0x272443 < 0xf; _0x272443++) { var _0x345f77 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; if (_0x345f77 != 0x0) { _0x107717 += String.fromCharCode(_0x345f77); } } var _0x100ad5 = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x4d17a5 = ''; for (var _0x272443 = 0x0; _0x272443 < 0x10; _0x272443++) { var _0x345f77 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; if (_0x345f77 != 0x0) { _0x4d17a5 += String.fromCharCode(_0x345f77); } } plList.push({ 'pid': _0x39e33f, 'ip': _0x107717, 'uid': _0x100ad5, 'name': _0x4d17a5 }); console.log(_0x39e33f + '|' + _0x107717 + '|' + _0x100ad5 + '|' + _0x4d17a5); _0x13f2f6++; } break; case 0x40: leftPos = _0x3bf81.getFloat64(_0xfbf61, true); _0xfbf61 += 0x8; topPos = _0x3bf81.getFloat64(_0xfbf61, true); _0xfbf61 += 0x8; rightPos = _0x3bf81.getFloat64(_0xfbf61, true); _0xfbf61 += 0x8; bottomPos = _0x3bf81.getFloat64(_0xfbf61, true); _0xfbf61 += 0x8; cameraManager.translate_x = (leftPos + rightPos) / 0x2; cameraManager.translate_y = (topPos + bottomPos) / 0x2; cameraManager.translate_x_current = cameraManager.translate_x; cameraManager.translate_y_current = cameraManager.translate_y; prog_background.initBuffer(); break; case 0x57: recordHolder = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; recordHolder += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; if (recordHolder == "KLAN SAVAŞLARI") { if (getLangCode() != 'tr') { recordHolder = "CLAN WAR"; } } break; case 0x58: clanMapPlayers = []; while (_0xfbf61 < _0x3bf81.byteLength) { var _0x15b0bc = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x2fe4d7 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; clanMapPlayers.push({ 'x': _0x15b0bc, 'y': _0x2fe4d7 }); } break; case 0x5a: teamMapPlayers = []; while (_0xfbf61 < _0x3bf81.byteLength) { var _0x15b0bc = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x2fe4d7 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; teamMapPlayers.push({ 'x': _0x15b0bc, 'y': _0x2fe4d7 }); } break; case 0x5b: addChat2(_0x3bf81, _0xfbf61); break; case 0x5c: var _0x1a216f = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; _0x1a216f += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; if (this.gameName != _0x1a216f) { wsClose(); console.log(this.gameName + '!=' + _0x1a216f); } break; case 0x5d: console.log("user logout by server"); var _0xfc1674 = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; _0xfc1674 += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; user_logout(_0xfc1674); break; case 0x5e: let _0x1e4ea9 = gold; gold = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; if (gold != _0x1e4ea9) { goldDiff += gold - _0x1e4ea9; } break; case 0x5f: var _0x35b232 = _0x3bf81.getUint8(_0xfbf61++); switch (_0x35b232) { case 0x1: topMessage1 = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; topMessage1 += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; topMessage1 = transMessage(topMessage1); break; case 0x2: topMessage2 = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; topMessage2 += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; topMessage2 = transMessage(topMessage2); break; case 0x3: topMessage3 = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; topMessage3 += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; topMessage3 = transMessage(topMessage3); break; } break; case 0x60: countdown = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; break; case 0x61: lastWinner = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; lastWinner += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; break; case 0x62: var _0xc8ad85 = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x3d4736 = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; setServerStatus(_0xc8ad85, _0x3d4736); break; case 0x63: break; case 0x64: updateNodes2(_0x3bf81, _0xfbf61); break; case 0x65: updateNodesExt(_0x3bf81, _0xfbf61); break; case 0x66: record_uid = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; recordHolder = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; recordHolder += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; if (recordHolder == "KLAN SAVAŞLARI") { if (getLangCode() != 'tr') { recordHolder = "CLAN WAR"; } } break; case 0x67: playerId = -0x1; spectatorId = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; setTimeout(function () { spectatorPlayer = getPlayerByPID(spectatorId); if (typeof isAdmin !== "undefined") { if (spectatorPlayer != null) { console.log("İzlenen Oyuncu:" + spectatorPlayer.uid + " " + spectatorPlayer.ip + " " + spectatorPlayer.name); } } }, 0x7d0); break; case 0x68: spectatorId = -0x1; playerId = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; break; case 0x69: window.location.reload(false); break; case 0x6a: var _0x35b232 = _0x3bf81.getUint8(_0xfbf61); _0xfbf61 += 0x1; console.log("üst mesajları sil " + _0x35b232); break; case 0x6b: winPrize = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; break; case 0x6c: enterPrice = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x1b8f39 = trans[0x107].replace("[GOLD]", enterPrice.dotFormat()); $("#enterPriceLine1").text(_0x1b8f39); break; case 0x6d: cameraManager.translate_x = cameraManager.translate_x_current; cameraManager.translate_y = cameraManager.translate_y_current; sendStart(); break; case 0x6e: serverVersion = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; if (serverVersion == "1332175218") { showGeneralError("Güncelleme sebebiyle odaya girilemiyor"); wsClose(); } break; case 0x6f: info = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; switch (info) { case 0x0: document.getElementById("overlays").style.display = "block"; canvasResize(); break; case 0x1: microphone.sendSoundOnOff_fromUI(); if (playMode == 0x2) { if (typeof isAdmin !== "undefined") { sendAdminSpectate(); getPlayerList(); } else { sendUint8(0x1); } } else { sendTeam(); sendSkinName(); sendScopeAround(); sendUserName(); if (typeof isAdmin !== "undefined") { spawnOnClick = true; } else { sendSpawnPlayer(); } } break; case 0x2: $("#overlays").hide(); $("#enterPriceConfirmDialog").show(); canvasResize(); break; case 0x3: delete localStorage.userToken; console.log("Token onaylanmadı!"); showGeneralError(trans[0x103], info); break; case 0x4: showGeneralError("Login tamamlanmadı!"); break; case 0x5: showGeneralError("Hesapsız ödeme yapılamaz! "); break; case 0x6: showGeneralError("Bu oda için ödeme yapmak gerekmiyor!"); break; case 0x7: showGeneralError("Ödeme daha önce yapılmış!"); break; case 0x8: showGeneralError(trans[0x105], info); break; case 0x9: showGeneralError(trans[0x104], info); break; case 0xa: console.log("oyuncu zaten spawn olmuş"); break; case 0xb: console.log("bu ks odasında izleme yapılamaz"); break; case 0xc: console.log("oyuncu oyunda, izleme yapılamaz"); playMode = 0x1; break; case 0xd: console.log("hata 13"); break; case 0xe: console.log("ücretli odanın izlemesi sadece ödeyenlere açık"); break; case 0xf: showGeneralError("Sadece yeni hesaplar bu odaya girebilir!"); break; case 0x10: console.log("öldün çık..."); closeFullscreen(); sendUint8(0x17); playMode = 0x0; playerId = -0x1; spectatorId = -0x1; isLockMouse = 0x0; isLockFood = 0x0; break; case 0x11: playMode = 0x2; isLockMouse = 0x0; isLockFood = 0x0; break; case 0x12: playMode = 0x1; isLockMouse = 0x0; isLockFood = 0x0; viewZoom = 0.3; break; } break; case 0x70: playerUserId = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; break; case 0x71: var _0x2fac74 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; var _0x15e8bc = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; switch (_0x2fac74) { case 0x1: playerMaxMass = _0x15e8bc; break; case 0x2: playerMaxCells = _0x15e8bc; break; case 0x3: virusMinAmount = _0x15e8bc; break; case 0x4: virusMaxAmount = _0x15e8bc; break; case 0x5: playerCount = _0x15e8bc; break; case 0x6: observerCount = _0x15e8bc; break; case 0x7: virusCount = _0x15e8bc; break; case 0x8: break; case 0x9: break; case 0xa: var _0x20da16 = new Date().getTime() - js_load_time; ping_last = _0x20da16 - _0x15e8bc; break; case 0xb: premiumPlayerCount = _0x15e8bc; break; case 0xc: premiumPlayerMinForBoost = _0x15e8bc; break; } break; case 0x72: var _0x185b16 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; $("#finalList").empty(); var _0x2b87b2 = "" + trans[0x3a] + "" + "" + trans[0x3c] + ""; $("#finalList").append(_0x2b87b2); for (var _0x13f2f6 = 0x0; _0x13f2f6 < _0x185b16; _0x13f2f6++) { var _0x100ad5 = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x54722e = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x4d17a5 = ''; var _0x3d4736 = 0x20; while (_0x3d4736 > 0x0) { _0x3d4736--; var _0x345f77 = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; if (_0x345f77 != 0x0) { _0x4d17a5 += String.fromCharCode(_0x345f77); } else { break; } } ; var _0x50d37c; if (_0x100ad5 != 0x0) { var _0x3f6418 = "//agarz.com/" + l + "/home/" + _0x100ad5; _0x50d37c = "" + _0x4d17a5 + ""; } else { _0x50d37c = _0x4d17a5; } $("#finalList").append("" + (_0x13f2f6 + 0x1) + "." + _0x50d37c + "" + _0x54722e.dotFormat() + ''); console.log(_0x13f2f6 + " " + _0x100ad5 + " " + _0x54722e + " " + _0x4d17a5); } $("#finalLeaderboardDialog").show(); canvasResize(); break; case 0x73: var _0x561dd7 = { "pID": _0x3bf81.getUint32(_0xfbf61, true) }; _0xfbf61 += 0x4; _0x561dd7.userId = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; _0x561dd7.clan_id = _0x3bf81.getInt32(_0xfbf61, true); _0xfbf61 += 0x4; _0x561dd7.clan_status = _0x3bf81.getUint8(_0xfbf61, true); _0xfbf61 += 0x1; if (_0x561dd7.clan_id > 0x0 && clanNameList[_0x561dd7.clan_id] == null) { clanNameList[_0x561dd7.clan_id] = "..."; getClanName(_0x561dd7.clan_id); } playerInfoList[_0x561dd7.pID] = _0x561dd7; break; case 0x74: addChat3Admin(_0x3bf81, _0xfbf61); break; case 0x75: var _0x1f6538 = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; console.log("OPCODE_S2C_CHAT_REMOVE " + _0x1f6538); chatManager.removeById(_0x1f6538); break; case 0x76: var _0xc2afec = _0x3bf81.getUint32(_0xfbf61, true); _0xfbf61 += 0x4; var _0x451ac4 = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; _0x451ac4 += String.fromCharCode(_0x345f77); } _0xfbf61 += 0x2; var _0x50dfaf = new DataView(new ArrayBuffer(_0x3bf81.byteLength - _0xfbf61)); var _0x1a216f = _0xfbf61; while (_0xfbf61 < _0x3bf81.byteLength) { var _0x26f2d1 = _0x3bf81.getUint8(_0xfbf61); _0x50dfaf.setUint8(_0xfbf61 - _0x1a216f, _0x26f2d1); _0xfbf61++; } microphone.s2c_voice(_0xc2afec, _0x451ac4, _0x50dfaf); break; case 0x78: var _0x1a821c = ''; var _0x345f77; while ((_0x345f77 = _0x3bf81.getUint16(_0xfbf61, true)) != 0x0) { _0xfbf61 += 0x2; _0x1a821c += String.fromCharCode(_0x345f77); } console.log("LOG:" + _0x1a821c); break; case 0x3a: goldToPrizeTime = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x4; break; case 0x3c: autoBigTime = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x4; break; case 0x79: leaderboardIndex = _0x3bf81.getUint16(_0xfbf61, true); _0xfbf61 += 0x2; break; case 0x7a: tid = _0x3bf81.getUint16(_0xfbf61, true); $("#overlays").hide(); $("#showMessageTxt").html(trans[tid]); $("#showMessageOverlays").show(); _0xfbf61 += 0x2; break; } } function setServerStatus(_0x2e07c9, _0xafc375) {} function addChat2(_0x17ee6d, _0x4755f4) { function _0x324ebe() { var _0x226c42 = ''; var _0x3ee9ab; while ((_0x3ee9ab = _0x17ee6d.getUint16(_0x4755f4, true)) != 0x0) { _0x4755f4 += 0x2; _0x226c42 += String.fromCharCode(_0x3ee9ab); } _0x4755f4 += 0x2; return _0x226c42; } var _0x4dfc24 = _0x17ee6d.getUint8(_0x4755f4++); var _0x27d7d4 = _0x17ee6d.getUint8(_0x4755f4++); var _0x4ed1a8 = _0x17ee6d.getUint8(_0x4755f4++); var _0x264bcd = (_0x4dfc24 << 0x10 | _0x27d7d4 << 0x8 | _0x4ed1a8).toString(0x10); while (_0x264bcd.length > 0x6) { _0x264bcd = '0' + _0x264bcd; } _0x264bcd = '#' + _0x264bcd; var _0xf54153 = _0x17ee6d.getUint32(_0x4755f4); _0x4755f4 += 0x4; let _0x717841 = _0x324ebe(); let _0xffcf17 = _0x324ebe(); chatManager.addChat(0x0, _0xf54153, _0x264bcd, _0x717841, _0xffcf17); chatManager.updateCursorStyleAgain(); } function addChat3Admin(_0x578110, _0x3965c0) { function _0x80cb62() { var _0x521a73 = ''; var _0x3490df; while ((_0x3490df = _0x578110.getUint16(_0x3965c0, true)) != 0x0) { _0x3965c0 += 0x2; _0x521a73 += String.fromCharCode(_0x3490df); } _0x3965c0 += 0x2; return _0x521a73; } var _0x271f1c = _0x578110.getUint8(_0x3965c0++); var _0x23583e = _0x578110.getUint8(_0x3965c0++); var _0x3d2500 = _0x578110.getUint8(_0x3965c0++); var _0x304821 = (_0x271f1c << 0x10 | _0x23583e << 0x8 | _0x3d2500).toString(0x10); while (_0x304821.length < 0x6) { _0x304821 = '0' + _0x304821; } _0x304821 = '#' + _0x304821; if (_0x271f1c == 0x0 && _0x23583e == 0x0 & _0x3d2500 == 0x0) { _0x304821 = "#FFFFFF"; } var _0x3f798e = _0x578110.getUint32(_0x3965c0); _0x3965c0 += 0x4; var _0x293560 = _0x578110.getUint32(_0x3965c0); _0x3965c0 += 0x4; let _0x2f78f4 = _0x80cb62(); let _0x310fa9 = _0x80cb62(); chatManager.addChat(_0x293560, _0x3f798e, _0x304821, _0x2f78f4, _0x310fa9); chatManager.updateCursorStyleAgain(); } const chatManager = new function () { this.chatList = []; this.CHAT_LIST_MAX = 0x96; this.CHAT_FONTSIZE = 0x12; this.CHAT_ACC_FONTSIZE = 0xc; this.CHAT_FONT = this.CHAT_FONTSIZE + "px Arial"; this.CHAT_FONT_BOLD = "bold " + this.CHAT_FONT; this.MSG_START = " : "; this.BG_ALPHA = 0.6; this.clear = function () { this.chatList = []; }; this.removeById = function (_0x360470) { var _0x4cdaf9 = -0x1; for (var _0x411364 = 0x0; _0x411364 < this.chatList.length; _0x411364++) { var _0x130bf9 = this.chatList[_0x411364]; if (_0x130bf9.chat_id == _0x360470) { _0x4cdaf9 = _0x411364; break; } } if (_0x4cdaf9 != -0x1) { this.chatList.splice(_0x4cdaf9, 0x1); } }; this.reset_msgLines = function () { for (var _0x1ab6d5 of this.chatList) { _0x1ab6d5.msgLines = []; _0x1ab6d5.msgLines_gl = []; } }; this.addChat = function (_0x4a55b8, _0x1ac9fa, _0x1a30e1, _0x969509, _0x3c3f09) { let _0x2d0bad = { 'chat_id': _0x4a55b8, 'userId': _0x1ac9fa, 'color': _0x1a30e1, 'color_gl': ColorManager.hexToRgb(_0x1a30e1).toGL(), 'time': Date.now(), 'name': _0x969509, 'name_x': 0x0, 'name_y': 0x0, 'name_w': 0x0, 'name_h': 0x0, 'message': _0x3c3f09, 'msg_x': 0x0, 'msg_y': 0x0, 'msg_tag': '', 'msg_full': '', 'msg_split': function () { if (this.msgLines.length > 0x0) { return; } var _0x4520c9 = _0x2d0bad.msg_getFontInfo(); ctx.font = _0x4520c9.font; var _0x73f30d = ''; var _0xa969e7 = this.msg_x; for (let _0xf733d of this.msg_full) { var _0x1a9451 = _0x73f30d + _0xf733d; var _0x2aa40f = _0xa969e7 + ctx.measureText(_0x1a9451).width; if (_0x2aa40f > mainCanvas.width) { let _0x4a658f = ctx.measureText(_0x73f30d).width; this.msgLines.push({ 'line': _0x73f30d, 'width': _0x4a658f }); _0x73f30d = _0xf733d; _0xa969e7 = 0x0; } else { _0x73f30d = _0x1a9451; } } if (_0x73f30d.length > 0x0) { let _0xe58631 = ctx.measureText(_0x73f30d).width; this.msgLines.push({ 'line': _0x73f30d, 'width': _0xe58631 }); } }, 'msgLines': [], 'msg_split_gl': function () { if (this.msgLines_gl.length > 0x0) { return; } var _0x1a79bf; if (this.userId == -0x1) { _0x1a79bf = ColorManager.Current_RGB_GL.Chat_Default; } else { if (this.msg_tag == "-t ") { _0x1a79bf = ColorManager.Current_RGB_GL.ChatT; } else { if (this.msg_tag == "-c ") { _0x1a79bf = ColorManager.Current_RGB_GL.ChatC; } else if (this.msg_tag == "-a ") { _0x1a79bf = ColorManager.Current_RGB_GL.ChatA; } else { _0x1a79bf = ColorManager.Current_RGB_GL.ChatElse; } } } var _0x423c6f = ''; var _0x5a359c = this.msg_x; for (let _0x4d4299 of this.msg_full) { var _0x18bdf0 = _0x423c6f + _0x4d4299; var _0x1087c4 = _0x5a359c + prog_font.getTextWidth(_0x18bdf0) * chatManager.CHAT_FONTSIZE; if (_0x1087c4 > mainCanvas.width) { let _0x4a93a9 = prog_font.getTextWidth(_0x423c6f) * chatManager.CHAT_FONTSIZE; this.msgLines_gl.push({ 'line': _0x423c6f, 'width': _0x4a93a9, 'color': _0x1a79bf }); _0x423c6f = _0x4d4299; _0x5a359c = 0x0; } else { _0x423c6f = _0x18bdf0; } } if (_0x423c6f.length > 0x0) { let _0x37f473 = prog_font.getTextWidth(_0x423c6f) * chatManager.CHAT_FONTSIZE; this.msgLines_gl.push({ 'line': _0x423c6f, 'width': _0x37f473, 'color': _0x1a79bf }); } }, 'msgLines_gl': [], 'msg_getFontInfo': function () { var _0x29693c; var _0x2bbaf2; if (this.userId == -0x1) { _0x2bbaf2 = chatManager.CHAT_FONT; _0x29693c = ColorManager.Current.Chat_Default; } else { if (this.msg_tag == "-t ") { _0x2bbaf2 = chatManager.CHAT_FONT; _0x29693c = ColorManager.Current.ChatT; } else { if (this.msg_tag == "-c ") { _0x2bbaf2 = chatManager.CHAT_FONT; _0x29693c = ColorManager.Current.ChatC; } else if (this.msg_tag == "-a ") { _0x2bbaf2 = chatManager.CHAT_FONT_BOLD; _0x29693c = ColorManager.Current.ChatA; } else { _0x2bbaf2 = chatManager.CHAT_FONT; _0x29693c = ColorManager.Current.ChatElse; } } } return { 'font': _0x2bbaf2, 'fillStyle': _0x29693c }; }, 'msg_setFont': function () { var _0x33ea45 = this.msg_getFontInfo(); ctx.font = _0x33ea45.font; ctx.fillStyle = _0x33ea45.fillStyle; }, 'msg_parse': function () { var _0x4caccc = this.message.trim(); this.msg_tag = _0x4caccc.substring(0x0, 0x3); if (this.msg_tag == "-t " || this.msg_tag == "-c " || this.msg_tag == "-a ") { this.msg_full = chatManager.MSG_START + _0x4caccc.substring(0x3); } else { this.msg_full = chatManager.MSG_START + _0x4caccc; } }, 'isVisible': function () { if (chatFilter.checked == true) { switch (Number(localStorage.chatMode)) { case 0x1: if (this.msg_tag != "-t ") { return false; } break; case 0x2: if (this.msg_tag != "-c ") { return false; } break; case 0x3: if (this.msg_tag != "-a ") { return false; } break; case 0x0: if (this.msg_tag == "-t " || this.msg_tag == "-c " || this.msg_tag == "-a ") { return false; } break; } } return true; }, 'del_x': 0x0, 'del_y': 0x0, 'del_w': 0x0, 'del_h': 0x0 }; _0x2d0bad.msg_parse(); this.chatList.push(_0x2d0bad); if (isMobile == false && this.chatList.length > this.CHAT_LIST_MAX) { this.chatList.shift(); } }; this.updateCursorStyle = function (_0x1fcf5e, _0x326e37) { mainCanvas.style.cursor = "default"; for (let _0x225fc8 of this.chatList) { if (_0x225fc8.userId != 0x0 && _0x225fc8.userId != undefined) { if (_0x1fcf5e >= _0x225fc8.name_x && _0x1fcf5e <= _0x225fc8.name_x + _0x225fc8.name_w && _0x326e37 <= _0x225fc8.name_y && _0x326e37 >= _0x225fc8.name_y - _0x225fc8.name_h) { mainCanvas.style.cursor = "pointer"; break; } } } }; this.updateCursorStyleAgain = function () { this.updateCursorStyle(0x0, 0x0); }; this.draw = function (_0x431d30, _0x46ee84, _0x4c5180) { if (options.get("hideChat")) { return; } var _0x5864a3 = 0x0; for (let _0x21e550 of this.chatList) { _0x21e550.name_x = 0x0; _0x21e550.name_y = 0x0; _0x21e550.name_w = 0x0; _0x21e550.name_h = 0x0; _0x21e550.msg_x = 0x0; _0x21e550.msg_y = 0x0; _0x21e550.del_x = 0x0; _0x21e550.del_y = 0x0; _0x21e550.del_w = 0x0; _0x21e550.del_h = 0x0; } var _0x4bddf8 = mainCanvas.height - _0x46ee84; for (var _0x511bbf = this.chatList.length - 0x1; _0x511bbf >= 0x0; _0x511bbf--) { var _0x21b07b = this.chatList[_0x511bbf]; var _0x589387 = _0x431d30; _0x21b07b.name = _0x21b07b.name.trim(); if (_0x21b07b.name == '') { _0x21b07b.name = "AgarZ"; } if (_0x21b07b.isVisible() == false) { continue; } _0x5864a3++; if (_0x4c5180 != 0x0 && _0x5864a3 > _0x4c5180) { break; } if (_0x4c5180 == 0x0 && _0x4bddf8 <= this.CHAT_FONTSIZE * 0x1) { break; } var _0x215390 = 0x0; switch (renderMode) { case 0x1: if (_0x21b07b.msgLines.length > 0x1) { _0x215390 = (_0x21b07b.msgLines.length - 0x1) * this.CHAT_FONTSIZE; } break; case 0x2: if (_0x21b07b.msgLines_gl.length > 0x1) { _0x215390 = (_0x21b07b.msgLines_gl.length - 0x1) * this.CHAT_FONTSIZE; } break; } if (_0x21b07b.chat_id != 0x0 && ipdiscord == 0x1) { _0x21b07b.del_x = _0x589387; _0x21b07b.del_y = _0x4bddf8 - _0x215390; _0x21b07b.del_w = this.CHAT_FONTSIZE; _0x21b07b.del_h = this.CHAT_FONTSIZE; _0x589387 += _0x21b07b.del_w; switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.Admin_MenuIcon; ctx.fillRect(_0x21b07b.del_x, _0x21b07b.del_y, _0x21b07b.del_w, -_0x21b07b.del_h); break; case 0x2: prog_rect.draw(_0x21b07b.del_x, _0x21b07b.del_y, _0x21b07b.del_w, -_0x21b07b.del_h, ColorManager.Current_RGB_GL.Admin_MenuIcon, 0x1); break; } } if (_0x21b07b.userId == record_uid && record_uid != 0x0) { ctx.font = this.CHAT_FONT_BOLD; } else if (_0x21b07b.msg_tag == "-a ") { ctx.font = this.CHAT_FONT_BOLD; } else { ctx.font = this.CHAT_FONT; } _0x21b07b.name_x = _0x589387; _0x21b07b.name_y = _0x4bddf8 - _0x215390; switch (renderMode) { case 0x1: _0x21b07b.name_w = ctx.measureText(_0x21b07b.name).width; break; case 0x2: _0x21b07b.name_w = prog_font.getTextWidth(_0x21b07b.name) * this.CHAT_FONTSIZE; break; } if (_0x21b07b.name_w < 0x14) { _0x21b07b.name_w = 0x14; } _0x21b07b.name_h = this.CHAT_FONTSIZE; if (_0x21b07b.userId != -0x1) { if (renderMode == 0x1) { ctx.fillStyle = ColorManager.Current.Chat_BG; ctx.fillRect(_0x21b07b.name_x, _0x21b07b.name_y + 0x2, _0x21b07b.name_w, -_0x21b07b.name_h - 0x2); ctx.fillStyle = _0x21b07b.color; ctx.fillText(_0x21b07b.name, _0x21b07b.name_x, _0x21b07b.name_y); } else if (renderMode == 0x2) { prog_rect.draw(_0x21b07b.name_x, _0x21b07b.name_y + 0x2, _0x21b07b.name_w, -_0x21b07b.name_h - 0x2, ColorManager.Current_RGB_GL.Chat_BG, 0.99); prog_font.drawUI(_0x21b07b.name_x, _0x21b07b.name_y, _0x21b07b.color_gl, 0x1, this.CHAT_FONTSIZE, _0x21b07b.name); } } else { ctx.fillStyle = ColorManager.Current.Chat_BG; ctx.fillRect(_0x21b07b.name_x, _0x21b07b.name_y + 0x2, _0x21b07b.name_w, -_0x21b07b.name_h - 0x2); ctx.fillStyle = ColorManager.Current.Chat_Guest; ctx.fillText("iii", _0x21b07b.name_x, _0x21b07b.name_y); } _0x589387 += _0x21b07b.name_w; if (options.get('accNoShow') == true) { _0x589387 += 0x2; let _0x291723 = '#' + _0x21b07b.userId.dotFormat(" "); switch (renderMode) { case 0x1: ctx.font = "italic " + this.CHAT_ACC_FONTSIZE + "px Arial"; ctx.fillStyle = ColorManager.Current.Chat_BG; let _0x2207c3 = ctx.measureText(_0x291723).width; ctx.fillRect(_0x589387 - 0x2, _0x21b07b.name_y + 0x2, _0x2207c3 + 0x4, -(this.CHAT_ACC_FONTSIZE + 0x2)); ctx.fillStyle = ColorManager.Current.Chat_AccNo; ctx.fillText(_0x291723, _0x589387, _0x21b07b.name_y); _0x589387 += _0x2207c3 + 0x2; break; case 0x2: let _0x59e114 = prog_font.getTextWidth(_0x291723) * this.CHAT_ACC_FONTSIZE; prog_rect.draw(_0x589387 - 0x2, _0x21b07b.name_y + 0x2, _0x59e114 + 0x4, -(this.CHAT_ACC_FONTSIZE + 0x2), ColorManager.Current_RGB_GL.Chat_BG, this.BG_ALPHA); let _0x459b4d = prog_font.drawUI(_0x589387, _0x21b07b.name_y, ColorManager.Current_RGB_GL.Chat_AccNo, this.BG_ALPHA, this.CHAT_ACC_FONTSIZE, _0x291723); _0x589387 += _0x459b4d + 0x2; break; } } _0x21b07b.msg_x = _0x589387; _0x21b07b.msg_y = _0x4bddf8 - _0x215390; switch (renderMode) { case 0x1: _0x21b07b.msg_split(); var _0x1c864f = _0x21b07b.msg_getFontInfo(); ctx.font = _0x1c864f.font; for (let _0x23c379 = 0x0; _0x23c379 < _0x21b07b.msgLines.length; _0x23c379++) { var _0xa93e3b; if (_0x23c379 == 0x0) { _0xa93e3b = _0x21b07b.msg_x; } else { _0xa93e3b = 0x0; } var _0x53b29e = _0x21b07b.msg_y + _0x23c379 * this.CHAT_FONTSIZE; ctx.fillStyle = ColorManager.Current.Chat_BG; ctx.fillRect(_0xa93e3b, _0x53b29e + 0x2, _0x21b07b.msgLines[_0x23c379].width, -this.CHAT_FONTSIZE); ctx.fillStyle = _0x1c864f.fillStyle; ctx.fillText(_0x21b07b.msgLines[_0x23c379].line, _0xa93e3b, _0x53b29e); } _0x4bddf8 -= this.CHAT_FONTSIZE * _0x21b07b.msgLines.length + 0x2; break; case 0x2: _0x21b07b.msg_split_gl(); for (let _0x177927 = 0x0; _0x177927 < _0x21b07b.msgLines_gl.length; _0x177927++) { var _0xa93e3b; if (_0x177927 == 0x0) { _0xa93e3b = _0x21b07b.msg_x; } else { _0xa93e3b = 0x0; } var _0x53b29e = _0x21b07b.msg_y + _0x177927 * this.CHAT_FONTSIZE; prog_rect.draw(_0xa93e3b, _0x53b29e + 0x2, _0x21b07b.msgLines_gl[_0x177927].width, -this.CHAT_FONTSIZE, ColorManager.Current_RGB_GL.Chat_BG, this.BG_ALPHA); prog_font.drawUI(_0xa93e3b, _0x53b29e, _0x21b07b.msgLines_gl[_0x177927].color, 0x1, this.CHAT_FONTSIZE, _0x21b07b.msgLines_gl[_0x177927].line); } _0x4bddf8 -= this.CHAT_FONTSIZE * _0x21b07b.msgLines_gl.length + 0x2; break; } } }; }(); function updateNodesExt(_0x1b528c, _0x29171c) { var _0x28dac8 = _0x1b528c.getUint16(_0x29171c, true); _0x29171c += 0x2; var _0x293cd5 = _0x1b528c.getUint16(_0x29171c, true); _0x29171c += 0x2; for (var _0x224c68 = 0x0; _0x224c68 < _0x293cd5; _0x224c68++) { var _0x50cb1f = _0x1b528c.getUint16(_0x29171c, true); _0x29171c += 0x2; var _0x3f27c4 = ''; while (true) { var _0x5bcea6 = _0x1b528c.getUint16(_0x29171c, true); _0x29171c += 0x2; if (_0x5bcea6 == 0x0) { break; } _0x3f27c4 += String.fromCharCode(_0x5bcea6); } if (_0x50cb1f == playerId) { playerName = _0x3f27c4; } skinName = ''; while (true) { var _0xc2d891 = _0x1b528c.getUint16(_0x29171c, true); _0x29171c += 0x2; if (0x0 == _0xc2d891) { break; } skinName += String.fromCharCode(_0xc2d891); } if (_0x28dac8 > 0x0 && clanNameList[_0x28dac8] == null) { clanNameList[_0x28dac8] = "..."; getClanName(_0x28dac8); } cellManager.s2c_updateExt(_0x50cb1f, _0x28dac8, _0x3f27c4, skinName); } } function updateNodes2(_0x47605c, _0x4796cd) { var _0x46ebf8 = new Date().getTime(); if (_0x46ebf8 == updateNodes2_last) {} else { updateNodes2_prev = updateNodes2_last; updateNodes2_last = _0x46ebf8; updateNodes2_span = updateNodes2_last - updateNodes2_prev; } timestamp = +new Date(); var _0x46ad77 = 0x0; for (var _0x54fae4 = 0x0;;) { var _0x37d69e = _0x47605c.getUint32(_0x4796cd, true); _0x4796cd += 0x4; if (0x0 == _0x37d69e) { break; } ++_0x54fae4; _0x46ad77++; var _0x520088 = _0x47605c.getInt16(_0x4796cd, true); _0x4796cd += 0x2; var _0x109b9e = _0x47605c.getInt16(_0x4796cd, true); _0x4796cd += 0x2; var _0x59aadd = _0x47605c.getInt16(_0x4796cd, true); _0x4796cd += 0x2; var _0x4ca0ff = _0x47605c.getUint8(_0x4796cd++); var _0x51d9aa = _0x47605c.getUint8(_0x4796cd++); var _0x3ea2f6 = _0x47605c.getUint8(_0x4796cd++); var _0x5274cd = (_0x4ca0ff << 0x10 | _0x51d9aa << 0x8 | _0x3ea2f6).toString(0x10); while (_0x5274cd.length < 0x6) { _0x5274cd = '0' + _0x5274cd; } _0x5274cd = '#' + _0x5274cd; var _0x25bf7a = _0x47605c.getUint8(_0x4796cd++); if (!(_0x25bf7a != 0x0 && _0x25bf7a != 0x1 && _0x25bf7a != 0x2 && _0x25bf7a != 0x3 && _0x25bf7a != 0x4 && _0x25bf7a != 0x5) == false) { console.log("cellType hatalı: " + _0x25bf7a); } var _0x12982d = _0x47605c.getUint16(_0x4796cd, true); _0x4796cd += 0x2; var _0x48c774 = getBoardArea(); if (_0x520088 < _0x48c774.x_min - _0x59aadd) { _0x520088 = _0x48c774.x_min - _0x59aadd; } else if (_0x520088 > _0x48c774.x_max + _0x59aadd) { _0x520088 = _0x48c774.x_max + _0x59aadd; } if (_0x109b9e < _0x48c774.y_min - _0x59aadd) { _0x109b9e = _0x48c774.y_min - _0x59aadd; } else if (_0x109b9e > _0x48c774.y_max + _0x59aadd) { _0x109b9e = _0x48c774.y_max + _0x59aadd; } cellManager.s2c_update(ctx, timestamp, _0x37d69e, _0x520088, _0x109b9e, _0x59aadd, _0x5274cd, [_0x4ca0ff, _0x51d9aa, _0x3ea2f6], _0x25bf7a, _0x12982d); } queueLength = _0x47605c.getUint32(_0x4796cd, true); _0x4796cd += 0x4; for (_0x54fae4 = 0x0; _0x54fae4 < queueLength; _0x54fae4++) { var _0x1859f3 = _0x47605c.getUint32(_0x4796cd, true); _0x4796cd += 0x4; cellManager.s2c_destroy(_0x1859f3); } if (cellManager.playerCellList.length == 0x0 && drawMapDstPoint == true) { mapDstX = mapx; mapDstY = mapy; } userScoreCurrent = calcUserScore(); userScoreMax = Math.max(userScoreMax, userScoreCurrent); if (cellManager.drawMode == 0x0) { cellManager.newRecord(); } } function sendMouseMove() { if (ws != null && ws.readyState == ws.OPEN) { var _0x156868 = cameraManager.getMouseCoordinate(); moveToX = _0x156868.x; moveToY = _0x156868.y; if (Math.abs(moveToXold - moveToX) > 0xa || Math.abs(moveToYold - moveToY) > 0xa) { if (isLockMouse == 0x0) { moveToXold = moveToX; moveToYold = moveToY; var _0x46eb57 = prepareData(0x15); _0x46eb57.setUint8(0x0, 0x10); _0x46eb57.setFloat64(0x1, moveToX, true); _0x46eb57.setFloat64(0x9, moveToY, true); _0x46eb57.setUint32(0x11, 0x0, true); wsSend(_0x46eb57); } } } } function sendSkinName() { var _0x35415a = document.getElementById("txtSkin").value; var _0x171e07 = _0x35415a.toLowerCase(); if (ws != null && ws.readyState == ws.OPEN && null != _0x171e07) { var _0x28c41d = prepareData(0x1 + 0x2 * _0x171e07.length); _0x28c41d.setUint8(0x0, 0x2); for (var _0x58ae55 = 0x0; _0x58ae55 < _0x171e07.length; ++_0x58ae55) { _0x28c41d.setUint16(0x1 + 0x2 * _0x58ae55, _0x171e07.charCodeAt(_0x58ae55), true); } wsSend(_0x28c41d); } } function sendUserName() { var _0x519c4d = document.getElementById("nick").value; var _0x26a10b = prepareData(0x1 + 0x2 * _0x519c4d.length); _0x26a10b.setUint8(0x0, 0x7); for (var _0x316750 = 0x0; _0x316750 < _0x519c4d.length; ++_0x316750) { _0x26a10b.setUint16(0x1 + 0x2 * _0x316750, _0x519c4d.charCodeAt(_0x316750), true); } wsSend(_0x26a10b); console.log("sendUserName"); } function sendSpawnPlayer() { var _0x41182f = prepareData(0x1); _0x41182f.setUint8(0x0, 0x9); wsSend(_0x41182f); } function sendConfirmPay() { var _0x1ba094 = prepareData(0x1); _0x1ba094.setUint8(0x0, 0xa); wsSend(_0x1ba094); } function sendTeam() { var _0x33b640 = document.getElementById("myTeam").value; if (ws != null && ws.readyState == ws.OPEN && _0x33b640 != null) { var _0x1dcdb5 = prepareData(0x1 + 0x2 * _0x33b640.length); var _0x381282 = 0x0; _0x1dcdb5.setUint8(_0x381282++, 0x1a); for (var _0x22fb94 = 0x0; _0x22fb94 < _0x33b640.length; ++_0x22fb94) { var _0x4020ff = _0x33b640.charCodeAt(_0x22fb94); _0x1dcdb5.setUint16(_0x381282, _0x4020ff, true); _0x381282 += 0x2; } wsSend(_0x1dcdb5); teamSent = _0x33b640; } } function sendChat(_0x18d98d) { if (ws != null && ws.readyState == ws.OPEN && _0x18d98d.length < 0xc8 && _0x18d98d.length > 0x0) { switch (Number(localStorage.chatMode)) { case 0x0: break; case 0x1: _0x18d98d = "-t " + _0x18d98d; break; case 0x2: _0x18d98d = "-c " + _0x18d98d; break; case 0x3: _0x18d98d = "-a " + _0x18d98d; break; default: console.log("Bilinmeyen chatmode değeri! " + localStorage.chatMode); break; } var _0x179296 = prepareData(0x2 + 0x2 * _0x18d98d.length); var _0x17b341 = 0x0; _0x179296.setUint8(_0x17b341++, 0x63); _0x179296.setUint8(_0x17b341++, 0x0); for (var _0x419ee4 = 0x0; _0x419ee4 < _0x18d98d.length; ++_0x419ee4) { _0x179296.setUint16(_0x17b341, _0x18d98d.charCodeAt(_0x419ee4), true); _0x17b341 += 0x2; } wsSend(_0x179296); } } function wsIsOpen() { return ws != null && ws.readyState == ws.OPEN; } function sendUint8(_0x1211ad) { if (ws != null && ws.readyState == ws.OPEN) { var _0x3ad681 = prepareData(0x1); _0x3ad681.setUint8(0x0, _0x1211ad); wsSend(_0x3ad681); } } function redrawGameScene() { drawGameScene(); window.requestAnimationFrame(redrawGameScene); } function canvasResize() { window.scrollTo(0x0, 0x0); mainCanvas.width = window.innerWidth; mainCanvas.height = window.innerHeight; webgl.onCanvasResize(window.innerWidth, window.innerHeight); chatManager.reset_msgLines(); var _0x239e22 = $('#helloDialog'); _0x239e22.css("transform", "none"); var _0x10be54 = _0x239e22.height(); var _0x9ba5d8 = mainCanvas.height / _0x10be54; if (_0x9ba5d8 < 0x1) { if (_0x9ba5d8 < 0.1) { _0x9ba5d8 = 0x1; } _0x239e22.css("transform", "translate(-50%, -50%) scale(" + _0x9ba5d8 + ')'); } else { _0x239e22.css('transform', "translate(-50%, -50%)"); } drawGameScene(); } function drawTouchMark() { if (!isTouchDevice) { return; } if (touchStart != null && touchMove != null) { ctx.beginPath(); ctx.strokeStyle = ColorManager.Current.TouchMark; ctx.lineWidth = 0x6; ctx.moveTo(touchStart.clientX, touchStart.clientY); ctx.lineTo(touchMove.clientX, touchMove.clientY); ctx.stroke(); } } function drawRoomInfo(_0x1e3eba) { if (!options.get("showInfo")) { return; } var _0x11e51f; switch (renderMode) { case 0x1: ctx.globalAlpha = 0.8; ctx.fillStyle = ColorManager.Current.RoomInfo; ctx.font = "16px Ubuntu"; var _0x1251c7 = mainCanvas.height - 160 - 0x1e; _0x1251c7 += 0x10; _0x4433a0 = "Ping: " + ping_last; _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x4433a0 = "Fps: " + Math.round(fpsManager.fps); _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x1251c7 += 0x10; var _0x4433a0 = trans[0x10d] + ": " + playerMaxMass.dotFormat(); var _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x4433a0 = trans[0x10e] + ": " + playerMaxCells; _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x4433a0 = trans[0x10f] + ": " + virusCount; _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x4433a0 = trans[0x110] + ": " + playerCount; _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x4433a0 = "Premium-" + trans[0x110] + ": " + premiumPlayerCount + '/' + premiumPlayerMinForBoost; _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); _0x1251c7 += 0x10; _0x4433a0 = trans[0x111] + ": " + observerCount; _0x11e51f = ctx.measureText(_0x4433a0).width; ctx.fillText(_0x4433a0, mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7); break; case 0x2: let _0x167c41 = ColorManager.Current_RGB_GL.RoomInfo; var _0x1251c7 = mainCanvas.height - 144 - 0x1e; _0x4433a0 = "Ping: " + ping_last; _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x4433a0 = "Fps: " + Math.round(fpsManager.fps); _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x1251c7 += 0x10; var _0x4433a0 = trans[0x10d] + ": " + playerMaxMass.dotFormat(); _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x4433a0 = trans[0x10e] + ": " + playerMaxCells; _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x4433a0 = trans[0x10f] + ": " + virusCount; _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x4433a0 = trans[0x110] + ": " + playerCount; _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x4433a0 = "Premium-" + trans[0x110] + ": " + premiumPlayerCount + '/' + premiumPlayerMinForBoost; _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); _0x1251c7 += 0x10; _0x4433a0 = trans[0x111] + ": " + observerCount; _0x11e51f = prog_font.getTextWidth(_0x4433a0) * 0x10; prog_font.drawUI(mainCanvas.width - _0x11e51f - _0x1e3eba, _0x1251c7, _0x167c41, 0x1, 0x10, _0x4433a0); break; } } function drawClear() { switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.Clear; ctx.fillRect(0x0, 0x0, mainCanvas.width, mainCanvas.height); break; case 0x2: prog_rect.draw(0x0, 0x0, webgl.canvas_gl.width, webgl.canvas_gl.height, ColorManager.Current_RGB_GL.Clear, 0x1); break; } } function drawBorder() { switch (renderMode) { case 0x1: ctx.strokeStyle = ColorManager.Current.Border; ctx.lineWidth = 0x32; ctx.lineCap = "butt"; ctx.lineJoin = "butt"; ctx.beginPath(); ctx.moveTo(leftPos, topPos); ctx.lineTo(rightPos, topPos); ctx.lineTo(rightPos, bottomPos); ctx.lineTo(leftPos, bottomPos); ctx.closePath(); ctx.stroke(); ctx.strokeStyle = ColorManager.Current.Grid; ctx.globalAlpha = 0.2; ctx.lineWidth = 0x1; if (cameraManager.scale > 0.07) { ctx.beginPath(); for (var _0x4a38ac = leftPos; _0x4a38ac <= rightPos; _0x4a38ac += 0x64) { ctx.moveTo(_0x4a38ac, topPos); ctx.lineTo(_0x4a38ac, bottomPos); } for (var _0x1146f4 = topPos; _0x1146f4 <= bottomPos; _0x1146f4 += 0x64) { ctx.moveTo(leftPos, _0x1146f4); ctx.lineTo(rightPos, _0x1146f4); } ctx.stroke(); } break; case 0x2: prog_background.draw(); break; } } function drawTimerAndRecord(_0xd6a30f, _0x593b2b, _0x365cf2) { var _0x2c47d5 = countdown; if (cellManager.drawMode == 0x1 || cellManager.drawMode == 0x2) { var _0x1463ad = cellManager.getReplayItem(); if (_0x1463ad != null) { _0x2c47d5 = _0x1463ad.countdown; } } var _0x2e23ed = ''; if (typeof this.gameName !== 'undefined' && this.gameName != null) { _0x2e23ed += this.gameName + " "; } _0x2e23ed += '[' + secToTime(_0x2c47d5) + ']'; ctx.font = _0x593b2b + "px Ubuntu"; var _0x4082c2 = ctx.measureText(_0x2e23ed).width; var _0x27a0ed = ColorManager.Current.TimerAndRecord_BG; var _0x108677 = (mainCanvas.width - _0x4082c2) * 0.5; switch (renderMode) { case 0x1: ctx.globalAlpha = 0.4; ctx.fillStyle = _0x27a0ed; ctx.fillRect(_0x108677 - _0x365cf2, _0xd6a30f, _0x4082c2 + _0x365cf2 * 0x2, _0x593b2b + _0x365cf2 * 0x2); ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.TimerAndRecord_Timer; ctx.fillText(_0x2e23ed, _0x108677, _0xd6a30f + _0x593b2b); if (recordHolder.length > 0x0) { _0xd6a30f += _0x593b2b + 0x2 * _0x365cf2; var _0x272055 = ctx.measureText(recordHolder).width; var _0x108677 = (mainCanvas.width - _0x272055) * 0.5; ctx.globalAlpha = 0.4; ctx.fillStyle = _0x27a0ed; ctx.fillRect(_0x108677 - _0x365cf2, _0xd6a30f, _0x272055 + _0x365cf2 * 0x2, _0x593b2b + _0x365cf2 * 0x2); ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.TimerAndRecord_Record; ctx.fillText(recordHolder, _0x108677, _0xd6a30f + _0x593b2b); } break; case 0x2: prog_rect.draw(_0x108677 - _0x365cf2, _0xd6a30f, _0x4082c2 + _0x365cf2 * 0x2, _0x593b2b + _0x365cf2 * 0x2, ColorManager.Current_RGB_GL.TimerAndRecord_BG, 0.2); prog_font.drawUI(_0x108677, _0xd6a30f + _0x593b2b, ColorManager.Current_RGB_GL.TimerAndRecord_Timer, 0x1, _0x593b2b, _0x2e23ed); if (recordHolder.length > 0x0) { _0xd6a30f += _0x593b2b + 0x2 * _0x365cf2; var _0x108677 = prog_font.getCenterX(recordHolder, _0x593b2b); var _0x416c5e = prog_font.getTextWidth(recordHolder) * _0x593b2b; prog_rect.draw(_0x108677 - _0x365cf2, _0xd6a30f, _0x416c5e + _0x365cf2 * 0x2, _0x593b2b + _0x365cf2 * 0x2, ColorManager.Current_RGB_GL.TimerAndRecord_BG, 0.2); prog_font.drawUI(_0x108677, _0xd6a30f + _0x593b2b, ColorManager.Current_RGB_GL.TimerAndRecord_Record, 0x1, _0x593b2b, recordHolder); } break; } } function drawGoldInfo(_0x221c8a, _0x75700b) { var _0x1e1acd = "Gold " + gold.dotFormat(); var _0x2bfd56; switch (renderMode) { case 0x1: ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.Gold; ctx.font = "30px Ubuntu"; _0x2bfd56 = ctx.measureText(_0x1e1acd).width; ctx.fillText(_0x1e1acd, _0x221c8a, _0x75700b); break; case 0x2: prog_font.drawUI(_0x221c8a, _0x75700b, ColorManager.Current_RGB_GL.Gold, 0x1, 0x1e, _0x1e1acd); _0x2bfd56 = prog_font.getTextWidth(_0x1e1acd) * 0x1e; break; } if (goldDiff != 0x0) { if (goldDiff > 0x0) { var _0xd32114 = '+' + goldDiff; } else { var _0xd32114 = '' + goldDiff; } let _0x37700e = -Math.PI * 0.25 - Math.random() * Math.PI * 0.5; let _0x2f4be5 = Math.cos(_0x37700e) * 0x64; let _0x1bc1f = Math.sin(_0x37700e) * 0x64; var _0x5c6946 = 0x0; switch (renderMode) { case 0x1: _0x5c6946 = ctx.measureText(_0xd32114).width; break; case 0x2: _0x5c6946 = prog_font.getTextWidth(_0xd32114) * 0x1e; break; } new textMover(_0xd32114, 0xa + _0x2bfd56 - _0x5c6946, 0xf0, _0x2f4be5, _0x1bc1f, 0x7d0, ColorManager.Current.Gold, ColorManager.Current_RGB_GL.Gold); goldDiff = 0x0; } } function drawScore(_0x313ca3, _0x284548, _0x836e3f) { var _0x7ff5a4 = "Score"; var _0x1460c2 = "Max"; switch (getLangCode()) { case 'tr': _0x7ff5a4 = "Skor"; _0x1460c2 = "Maks."; break; case 'en': _0x7ff5a4 = "Score"; _0x1460c2 = "Max"; break; case 'es': _0x7ff5a4 = "Puntuación"; _0x1460c2 = "Max"; break; case 'de': _0x7ff5a4 = 'Ergebnis'; _0x1460c2 = "Max"; break; } let _0x4a548c = _0x7ff5a4 + ": " + userScoreCurrent.dotFormat(); let _0x55ce3c = _0x1460c2 + ": " + userScoreMax.dotFormat(); let _0x1b531f = trans[0x127] + ": " + cellManager.playerCellList.length + '/' + playerMaxCells; if (renderMode == 0x1) { ctx.globalAlpha = 0.8; ctx.fillStyle = ColorManager.Current.Score; ctx.font = _0x836e3f + "px Ubuntu"; ctx.fillText(_0x4a548c, _0x313ca3, _0x284548); ctx.fillText(_0x55ce3c, _0x313ca3, _0x284548 + _0x836e3f); ctx.fillText(_0x1b531f, _0x313ca3, _0x284548 + _0x836e3f * 0x2); } else { let _0x4f5adf = ColorManager.Current_RGB_GL.Score; prog_font.drawUI(_0x313ca3, _0x284548, _0x4f5adf, 0x1, _0x836e3f, _0x4a548c); prog_font.drawUI(_0x313ca3, _0x284548 + _0x836e3f, _0x4f5adf, 0x1, _0x836e3f, _0x55ce3c); prog_font.drawUI(_0x313ca3, _0x284548 + _0x836e3f * 0x2, _0x4f5adf, 0x1, _0x836e3f, _0x1b531f); } } function drawMap(_0x57a908, _0x23525e, _0x5004ac, _0xf02c5e) { if (renderMode == 0x1) { ctx.globalAlpha = 0.4; ctx.fillStyle = ColorManager.Current.Map_BG; ctx.fillRect(_0x57a908, _0x23525e, _0x5004ac, _0xf02c5e); ctx.globalAlpha = 0x1; } else if (renderMode == 0x2) { prog_rect.draw(_0x57a908, _0x23525e, _0x5004ac, _0xf02c5e, ColorManager.Current_RGB_GL.Map_BG, 0.4); } for (var _0x405f75 = 0x0; _0x405f75 < clanMapPlayers.length; _0x405f75++) { mapx = _0x57a908 + clanMapPlayers[_0x405f75].x / rightPos * _0x5004ac - 2.5; mapy = _0x23525e + clanMapPlayers[_0x405f75].y / bottomPos * _0xf02c5e - 2.5; switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.Name_SameClanOnMap; ctx.fillRect(mapx, mapy, 0x5, 0x5); break; case 0x2: prog_rect.draw(_0x57a908, _0x23525e, 0x5, 0x5, ColorManager.Current_RGB_GL.Name_SameClanOnMap, 0x1); break; } } for (var _0x405f75 = 0x0; _0x405f75 < teamMapPlayers.length; _0x405f75++) { mapx = _0x57a908 + teamMapPlayers[_0x405f75].x / rightPos * _0x5004ac - 2.5; mapy = _0x23525e + teamMapPlayers[_0x405f75].y / bottomPos * _0xf02c5e - 2.5; switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.Name_SameTeamOnMap; ctx.fillRect(mapx, mapy, 0x5, 0x5); break; case 0x2: prog_rect.draw(mapx, mapy, 0x5, 0x5, ColorManager.Current_RGB_GL.Name_SameTeamOnMap, 0x1); break; } } mapx = _0x57a908 + cameraManager.translate_x / rightPos * _0x5004ac - 2.5; mapy = _0x23525e + cameraManager.translate_y / bottomPos * _0xf02c5e - 2.5; switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.Map_Me; ctx.fillRect(mapx, mapy, 0x5, 0x5); break; case 0x2: prog_rect.draw(mapx, mapy, 0x5, 0x5, ColorManager.Current_RGB_GL.Map_Me, 0x1); break; } } function drawPosition(_0x39f334, _0x5c3630, _0x5eceea) { var _0x4f7aca = Math.round(cameraManager.translate_x / 0x3e8) + " , " + Math.round(cameraManager.translate_y / 0x3e8); if (_0x5eceea) { var _0x4ce512 = "share"; switch (getLangCode()) { case 'tr': _0x4ce512 = 'paylaş'; break; case 'en': _0x4ce512 = "share"; break; case 'es': _0x4ce512 = "compartir"; break; case 'de': _0x4ce512 = "aktie"; break; } _0x4f7aca += " " + _0x4ce512; } txtpos_share = "*** " + Math.round(cameraManager.translate_x / 0x3e8) + " , " + Math.round(cameraManager.translate_y / 0x3e8) + " ***"; txtpos_height = 0x10; if (renderMode == 0x1) { txtpos_width = ctx.measureText(_0x4f7aca).width; ctx.globalAlpha = 0x1; ctx.font = "16px Ubuntu"; ctx.fillStyle = ColorManager.Current.Position; ctx.fillText(_0x4f7aca, _0x39f334, _0x5c3630); } else if (renderMode == 0x2) { txtpos_width = prog_font.getTextWidth(_0x4f7aca) * txtpos_height; prog_font.drawUI(_0x39f334, _0x5c3630, ColorManager.Current_RGB_GL.Position, 0x1, 0x10, _0x4f7aca); } } function drawMoverList() { for (let _0x40f134 of textMoverList) { _0x40f134.update(); _0x40f134.draw(); } } function drawWinPrize(_0x53383c, _0x57b173) { var _0x28dd15 = trans[0xae] + " " + winPrize.dotFormat(); switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.Prize; ctx.font = "30px Ubuntu"; ctx.fillText(_0x28dd15, _0x53383c, _0x57b173); break; case 0x2: prog_font.drawUI(_0x53383c, _0x57b173, ColorManager.Current_RGB_GL.Prize, 0x1, 0x1e, _0x28dd15); break; } } function drawGoldToPrize(_0x2b3c06, _0x2a42a6) { if (goldToPrizeTime > 0x0) { var _0x3484eb = trans[0x148] + " " + secToTime(goldToPrizeTime); switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.GoldToPrize; ctx.font = "20px Ubuntu"; ctx.fillText(_0x3484eb, _0x2b3c06, _0x2a42a6); break; case 0x2: prog_font.drawUI(_0x2b3c06, _0x2a42a6, ColorManager.Current_RGB_GL.GoldToPrize, 0x1, 0x14, _0x3484eb); break; } } } function drawAutoBigTime(_0xd3692f, _0xd8340b) { if (autoBigTime <= 0x0) { return; } var _0x547d6c = trans[0x149] + " " + secToTime(autoBigTime); switch (renderMode) { case 0x1: ctx.fillStyle = ColorManager.Current.AutoBig; ctx.font = "20px Ubuntu"; ctx.fillText(_0x547d6c, _0xd3692f, _0xd8340b); break; case 0x2: prog_font.drawUI(_0xd3692f, _0xd8340b, ColorManager.Current_RGB_GL.AutoBig, 0x1, 0x14, _0x547d6c); break; } } function drawEnterPrice(_0x3a9d1e, _0x2e62bb) { if (enterPrice <= 0x0) { return; } var _0x4b620a = trans[0x10b] + ": " + enterPrice.dotFormat(); switch (renderMode) { case 0x1: ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.EnterPrice; ctx.font = "30px Ubuntu"; ctx.fillText(_0x4b620a, _0x3a9d1e, _0x2e62bb); break; case 0x2: prog_font.drawUI(_0x3a9d1e, _0x2e62bb, ColorManager.Current_RGB_GL.EnterPrice, 0x1, 0x1e, _0x4b620a); break; } } function drawTopMessage(_0x4ffde5, _0x4614a0) { var _0x5c0c9a; var _0x1e181e; let _0x10f577 = [topMessage1, topMessage2, topMessage3]; switch (renderMode) { case 0x1: ctx.font = _0x4614a0 + "px Ubuntu"; ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.TopMessage; _0x1e181e = _0x4ffde5; for (let _0x3cebf0 of _0x10f577) { var _0x3908d0 = ctx.measureText(_0x3cebf0).width; _0x5c0c9a = (mainCanvas.width - _0x3908d0) * 0.5; ctx.fillText(_0x3cebf0, _0x5c0c9a, _0x1e181e); _0x1e181e += _0x4614a0; } if (countdown <= _0x4614a0 && countdown > 0x0) { ctx.font = "40px Ubuntu"; _0x5c0c9a = (mainCanvas.width - ctx.measureText(trans[0x134]).width) * 0.5; _0x1e181e += _0x4614a0 + 0xa; ctx.fillStyle = ColorManager.Current.LastSeconds; ctx.fillText(trans[0x134], _0x5c0c9a, _0x1e181e); } break; case 0x2: _0x1e181e = _0x4ffde5; for (let _0x490f58 of _0x10f577) { var _0x3908d0 = prog_font.getTextWidth(_0x490f58) * _0x4614a0; _0x5c0c9a = (mainCanvas.width - _0x3908d0) * 0.5; prog_font.drawUI(_0x5c0c9a, _0x1e181e, ColorManager.Current_RGB_GL.TopMessage, 0x1, _0x4614a0, _0x490f58); _0x1e181e += _0x4614a0; } if (countdown <= _0x4614a0 && countdown > 0x0) { let _0x57356f = trans[0x134]; let _0x4d52ee = prog_font.getTextWidth(_0x57356f) * 0x28; _0x5c0c9a = (mainCanvas.width - _0x4d52ee) * 0.5; _0x1e181e += _0x4614a0 + 0xa; prog_font.drawUI(_0x5c0c9a, _0x1e181e, ColorManager.Current_RGB_GL.LastSeconds, 0x1, 0x28, _0x57356f); } break; } } function drawAdminInfo(_0x12ec91, _0x45f92b) { if (ipdiscord != 0x1) { return; } var _0x3c6f52; if (ipdiscord_isAdmin == 0x1) { _0x3c6f52 = "ADMIN"; } else { _0x3c6f52 = 'MODERATOR'; } switch (renderMode) { case 0x1: ctx.globalAlpha = 0x1; ctx.font = "30px Ubuntu"; ctx.fillStyle = ColorManager.Current.AdminInfo; ctx.fillText(_0x3c6f52, _0x12ec91, _0x45f92b); break; case 0x2: prog_font.drawUI(_0x12ec91, _0x45f92b, ColorManager.Current_RGB_GL.AdminInfo, 0x1, 0x1e, _0x3c6f52); break; } } function drawUserId(_0x1350ac, _0x79ae10) { if (playerUserId == 0x0) { return; } var _0x4c7fc2 = trans[0xc9] + " " + playerUserId; switch (renderMode) { case 0x1: ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.UserID; ctx.font = "20px Ubuntu"; ctx.fillText(_0x4c7fc2, _0x1350ac, _0x79ae10); break; case 0x2: prog_font.drawUI(_0x1350ac, _0x79ae10, ColorManager.Current_RGB_GL.UserID, 0x1, 0x14, _0x4c7fc2); break; } } function drawLockMouse() { if (!(isLockMouse == 0x1 && playMode == 0x1)) { return; } switch (renderMode) { case 0x1: ctx.strokeStyle = ColorManager.Current.LockMouse; ctx.globalAlpha = 0x1; ctx.lineWidth = 0x5; ctx.lineCap = 'round'; ctx.beginPath(); ctx.setLineDash([]); ctx.moveTo(lockMouseX - 0x32, lockMouseY - 0x32); ctx.lineTo(lockMouseX + 0x32, lockMouseY + 0x32); ctx.moveTo(lockMouseX + 0x32, lockMouseY - 0x32); ctx.lineTo(lockMouseX - 0x32, lockMouseY + 0x32); ctx.stroke(); ctx.beginPath(); ctx.lineWidth = 0x5; ctx.setLineDash([0x64]); for (var _0x56a417 of cellManager.playerCellList) { ctx.moveTo(_0x56a417.x_draw, _0x56a417.y_draw); ctx.lineTo(lockMouseX, lockMouseY); } ctx.stroke(); break; case 0x2: var _0xaa116e = [lockMouseX - 0x32, lockMouseY - 0x32, lockMouseX + 0x32, lockMouseY + 0x32, lockMouseX + 0x32, lockMouseY - 0x32, lockMouseX - 0x32, lockMouseY + 0x32]; prog_line.draw(0x0, 0x0, _0xaa116e, false, ColorManager.Current_RGB_GL.LockMouse); _0xaa116e = []; for (var _0x56a417 of cellManager.playerCellList) { _0xaa116e.push(...[_0x56a417.x_draw, _0x56a417.y_draw, lockMouseX, lockMouseY]); } prog_line.draw(0x0, 0x0, _0xaa116e, false, ColorManager.Current_RGB_GL.LockMouse); break; } } function drawMovePoint() { if (!isMobile) { return; } if (playMode != 0x1) { return; } switch (renderMode) { case 0x1: var _0x3f9284 = cameraManager.getMouseCoordinate(); var _0x387b8b = 0x5 / cameraManager.scale; ctx.globalAlpha = 0x1; ctx.fillStyle = ColorManager.Current.MovePoint; ctx.beginPath(); ctx.arc(_0x3f9284.x, _0x3f9284.y, _0x387b8b, 0x0, 0x2 * Math.PI, false); ctx.fill(); break; case 0x2: prog_rect.draw(rawMouseX, rawMouseY, 0x5, 0x5, ColorManager.Current_RGB_GL.MovePoint, 0x1); break; } } function drawViewArea() { if (!(viewArea != null && true)) { return; } ctx.lineWidth = 0xa; ctx.beginPath(); ctx.rect(viewArea.x_min, viewArea.y_min, viewArea.x_size, viewArea.y_size); ctx.stroke(); } function drawTest() { ctx.font = "32px Ubuntu"; ctx.fillStyle = "#FFFFFF"; var _0x343fae = fpsManager.getDeltaTime(); ctx.fillText("frameTime: " + _0x343fae, 0x0, 0x1f4); var _0x593a8c = fpsManager.fps; ctx.fillText("fps: " + _0x593a8c, 0x0, 0x21c); ctx.fillText("span: " + fpsManager.lastUpdateFrameSpan, 0x0, 0x244); } function drawGameScene() { mainCanvas.width = window.innerWidth; mainCanvas.height = window.innerHeight; webgl.canvas_gl.width = window.innerWidth; webgl.canvas_gl.height = window.innerHeight; webgl.draw_begin(); drawClear(); viewArea = cellManager.getViewArea(); var _0x3e5d45 = Date.now() - lastSendMouseMove; if (_0x3e5d45 > 0x32 && cellManager.drawMode == 0x0) { lastSendMouseMove = Date.now(); sendMouseMove(); } timestamp = Date.now(); cellManager.updatePos(); fpsManager.updateFrame(); cellManager.sort(); cameraManager.useGoldEffect(); ctx.save(); ctx.translate(mainCanvas.width / 0x2, mainCanvas.height / 0x2); cameraManager.update(); ctx.scale(cameraManager.scale, cameraManager.scale); ctx.translate(-cameraManager.translate_x_current, -cameraManager.translate_y_current); drawBorder(); webgl.initAlpha(); cellManager.drawAuto(ctx); drawMovePoint(); drawLockMouse(); if (renderMode == 0x1) { ctx.restore(); } microphone.drawPlayList(ctx); drawLeaderboard(); tutorial_zoom.draw(ctx); drawTimerAndRecord(0x0, 0x1e, 0x2); if (isMobile) { drawTopMessage(0x5a, 0xf); drawUserId(0x0, 0xc8); } else { drawTopMessage(0x5a, 0x1e); drawUserId(0xa, 0xc8); } if (isMobile) { if (mainCanvas.width > mainCanvas.height) { if (playMode == 0x1) { drawGoldInfo(0x0, 0x5a); } drawWinPrize(0x0, 0x6e); drawGoldToPrize(0x0, 0x5a); drawAutoBigTime(0x0, 0x46); } else { if (playMode == 0x1) { drawGoldInfo(0x0, 0x118); } drawWinPrize(0x0, 0x136); drawGoldToPrize(0x0, 0x14a); drawAutoBigTime(0x0, 0x15e); } } else { if (playMode == 0x1) { drawGoldInfo(0xa, 0x10e); } drawWinPrize(0xa, 0x12c); drawGoldToPrize(0xa, 0x140); drawAutoBigTime(0xa, 0x154); } drawMoverList(); drawAdminInfo(0x6e, 0x154); drawEnterPrice(0xa, 0x168); if (isMobile) { drawScore(0x0, mainCanvas.height - 0x55, 0xc); drawRoomInfo(0x0); } else { drawScore(0xa, 0x14, 0x12); drawRoomInfo(0x1e); } if (renderMode == 0x1) { ctx.globalAlpha = 0x1; } if (isMobile) { if (sb.chatShow.isShow) { chatManager.draw(0x0, 0x69, 0x0); } else { chatManager.draw(0x0, 0x5, 0x2); } } else { drawMap(0xa, 0x3c, 0x64, 0x64); drawPosition(0xa, 0xaf, true); chatManager.draw(0xa, 0x32, 0xf); } if (isMobile) { if (mainCanvas.width > mainCanvas.height) { sb.mainMenu.setPosition(0x0, 0x6e); sb.zoomIn.setPosition(0x37, 0x6e); sb.zoomOut.setPosition(0x6e, 0x6e); sb.useGold.setPosition(0x0, 0xa0); sb.useGoldBig.setPosition(0x37, 0xa0); sb.feed.setPosition(0x0, 0xd2); sb.split.setPosition(0x37, 0xd2); } else { sb.mainMenu.setPosition(0x0, 0xd2); sb.zoomIn.setPosition(0x37, 0xd2); sb.zoomOut.setPosition(0x6e, 0xd2); sb.useGold.setPosition(0x0, 0x168); sb.useGoldBig.setPosition(0x37, 0x168); sb.feed.setPosition(0x0, 0x1a4); sb.split.setPosition(0x37, 0x1a4); } if (playMode == 0x1) { for (var _0x52ce3f in sb) { sb[_0x52ce3f].draw(); } } else { sb.mainMenu.draw(); sb.zoomIn.draw(); sb.zoomOut.draw(); sb.chatShow.draw(); } } } function calcUserScore() { var _0x4ec86b = 0x0; for (var _0x2a3a92 = 0x0; _0x2a3a92 < cellManager.playerCellList.length; _0x2a3a92++) { _0x4ec86b += cellManager.playerCellList[_0x2a3a92].getScore(); } return _0x4ec86b; } window.wsSend = wsSend; window.wsClose = wsClose; window.getPlayerByPID = getPlayerByPID; sendScopeAround = function () { if (options.get("scopeAround")) { sendUint8(0x5); } else { sendUint8(0x6); } }; window.setserver4 = function () { cellManager.clearRecord(); cellManager.clearActive(); ws_url = $('#gamemode').val(); this.gameName = $("#gamemode option:selected").text(); wsClose(); }; window.setGameMode = function (_0x4b1665) { if (_0x4b1665 != gameMode) { gameMode = _0x4b1665; wsConnect(); } }; window.resetGold = function () { gold = 0x0; }; window.ping = function () { if (ws != null && ws.readyState == 0x1) { var _0x4d9bc5 = new Date().getTime() - js_load_time; var _0x3917b4 = prepareData(0x5); _0x3917b4.setUint8(0x0, 0xd); _0x3917b4.setInt32(0x1, _0x4d9bc5, true); wsSend(_0x3917b4); } }; function isAdminSafe() { return typeof isAdmin !== "undefined"; } function anyOrientation() { if (isMobile) { screen.orientation.lock("any"); screen.orientation.onchange = function (_0x32d80a) { console.log(_0x32d80a); }; canvasResize(); } } function openFullscreen() { if (!options.get('fullScreen')) { return; } if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen().then(() => { anyOrientation(); }); } else { if (document.documentElement.webkitRequestFullscreen) { document.documentElement.webkitRequestFullscreen().then(() => { anyOrientation(); }); } else if (document.documentElement.msRequestFullscreen) { document.documentElement.msRequestFullscreen().then(() => { anyOrientation(); }); } } } function closeFullscreen() { if (document.fullscreenElement == null) { return; } screen.orientation.unlock(); if (document.exitFullscreen) { document.exitFullscreen(); } else { if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } } } function onClickSpectate() { openFullscreen(); cellManager.drawMode = 0x0; cellManager.clearRecord(); playMode = 0x2; $("#overlays").hide(); if (ws == null || ws.readyState == 0x2 || ws.readyState == 0x3) { wsConnect(); } else { sendStart(); } } window.spectate = function () { onClickSpectate(); }; window.onClickPlay = function () { openFullscreen(); cellManager.drawMode = 0x0; cellManager.clearRecord(); $("#overlays").hide(); userScoreCurrent = 0x0; userScoreMax = 0x0; playMode = 0x1; if (ws == null) { wsConnect(); } else if (ws.readyState == 0x2 || ws.readyState == 0x3) { reconnect = 0x1; wsClose(); } else { sendStart(); } }; window.odulEkle_100k = function () { sendUint8(0x1b); }; window.odulekle_100k = function () { odulEkle_100k(); }; window.fork = function (_0x3c0a38) { var _0x281d21 = prepareData(0x2 + _0x3c0a38.length); _0x281d21.setUint8(0x0, 0x44); _0x281d21.setUint8(0x1, _0x3c0a38.length); const _0x11768a = '?'.charCodeAt(0x0); let _0x62f59a = 0x2; for (var _0xc67cdd = 0x0; _0xc67cdd < _0x3c0a38.length; ++_0xc67cdd) { let _0x48e328 = _0x3c0a38.charCodeAt(_0xc67cdd); if (_0x48e328 > 0xff) { _0x48e328 = _0x11768a; } _0x281d21.setUint8(_0x62f59a, _0x48e328); _0x62f59a += 0x1; } wsSend(_0x281d21); }; function debugChat(_0x117859) { chatManager.addChat(0x0, 0x0, "#0F0", "debug", _0x117859); }