Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.75 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Tank:triflank Press t or T to launch
  3. // @description Sandbox Tank Changer Script
  4. // @version 0.1
  5. // @author me
  6. // @namespace *://diep.io/
  7. // @match *://diep.io/
  8. // @grant none
  9. // ==/UserScript==
  10. var _createClass = function() {
  11. function n(t, e) {
  12. for (var r = 0; r < e.length; r++) {
  13. var n = e[r];
  14. n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n)
  15. }
  16. }
  17. return function(t, e, r) {
  18. return e && n(t.prototype, e), r && n(t, r), t
  19. }
  20. }(),
  21. _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  22. return typeof t
  23. } : function(t) {
  24. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  25. };
  26.  
  27. function _classCallCheck(t, e) {
  28. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  29. }! function o(s, u, a) {
  30. function f(e, t) {
  31. if (!u[e]) {
  32. if (!s[e]) {
  33. var r = "function" == typeof require && require;
  34. if (!t && r) return r(e, !0);
  35. if (h) return h(e, !0);
  36. var n = new Error("Cannot find module '" + e + "'");
  37. throw n.code = "MODULE_NOT_FOUND", n
  38. }
  39. var i = u[e] = {
  40. exports: {}
  41. };
  42. s[e][0].call(i.exports, function(t) {
  43. return f(s[e][1][t] || t)
  44. }, i, i.exports, o, s, u, a)
  45. }
  46. return u[e].exports
  47. }
  48. for (var h = "function" == typeof require && require, t = 0; t < a.length; t++) f(a[t]);
  49. return f
  50. }({
  51. 1: [function(t, e, r) {
  52. "use strict";
  53. r.byteLength = function(t) {
  54. var e = c(t),
  55. r = e[0],
  56. n = e[1];
  57. return 3 * (r + n) / 4 - n
  58. }, r.toByteArray = function(t) {
  59. var e, r, n = c(t),
  60. i = n[0],
  61. o = n[1],
  62. s = new h(function(t, e, r) {
  63. return 3 * (e + r) / 4 - r
  64. }(0, i, o)),
  65. u = 0,
  66. a = 0 < o ? i - 4 : i;
  67. for (r = 0; r < a; r += 4) e = f[t.charCodeAt(r)] << 18 | f[t.charCodeAt(r + 1)] << 12 | f[t.charCodeAt(r + 2)] << 6 | f[t.charCodeAt(r + 3)], s[u++] = e >> 16 & 255, s[u++] = e >> 8 & 255, s[u++] = 255 & e;
  68. 2 === o && (e = f[t.charCodeAt(r)] << 2 | f[t.charCodeAt(r + 1)] >> 4, s[u++] = 255 & e);
  69. 1 === o && (e = f[t.charCodeAt(r)] << 10 | f[t.charCodeAt(r + 1)] << 4 | f[t.charCodeAt(r + 2)] >> 2, s[u++] = e >> 8 & 255, s[u++] = 255 & e);
  70. return s
  71. }, r.fromByteArray = function(t) {
  72. for (var e, r = t.length, n = r % 3, i = [], o = 0, s = r - n; o < s; o += 16383) i.push(a(t, o, s < o + 16383 ? s : o + 16383));
  73. 1 == n ? (e = t[r - 1], i.push(u[e >> 2] + u[e << 4 & 63] + "==")) : 2 == n && (e = (t[r - 2] << 8) + t[r - 1], i.push(u[e >> 10] + u[e >> 4 & 63] + u[e << 2 & 63] + "="));
  74. return i.join("")
  75. };
  76. for (var u = [], f = [], h = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, o = n.length; i < o; ++i) u[i] = n[i], f[n.charCodeAt(i)] = i;
  77.  
  78. function c(t) {
  79. var e = t.length;
  80. if (0 < e % 4) throw new Error("Invalid string. Length must be a multiple of 4");
  81. var r = t.indexOf("=");
  82. return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4]
  83. }
  84.  
  85. function a(t, e, r) {
  86. for (var n, i, o = [], s = e; s < r; s += 3) n = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (255 & t[s + 2]), o.push(u[(i = n) >> 18 & 63] + u[i >> 12 & 63] + u[i >> 6 & 63] + u[63 & i]);
  87. return o.join("")
  88. }
  89. f["-".charCodeAt(0)] = 62, f["_".charCodeAt(0)] = 63
  90. }, {}],
  91. 2: [function(L, t, R) {
  92. (function(c) {
  93. "use strict";
  94. var n = L("base64-js"),
  95. o = L("ieee754"),
  96. t = "function" == typeof Symbol ? Symbol.for("nodejs.util.inspect.custom") : null;
  97. R.Buffer = c, R.SlowBuffer = function(t) {
  98. +t != t && (t = 0);
  99. return c.alloc(+t)
  100. }, R.INSPECT_MAX_BYTES = 50;
  101. var r = 2147483647;
  102.  
  103. function s(t) {
  104. if (r < t) throw new RangeError('The value "' + t + '" is invalid for option "size"');
  105. var e = new Uint8Array(t);
  106. return Object.setPrototypeOf(e, c.prototype), e
  107. }
  108.  
  109. function c(t, e, r) {
  110. if ("number" != typeof t) return i(t, e, r);
  111. if ("string" == typeof e) throw new TypeError('The "string" argument must be of type string. Received type number');
  112. return a(t)
  113. }
  114.  
  115. function i(t, e, r) {
  116. if ("string" == typeof t) return function(t, e) {
  117. "string" == typeof e && "" !== e || (e = "utf8");
  118. if (!c.isEncoding(e)) throw new TypeError("Unknown encoding: " + e);
  119. var r = 0 | l(t, e),
  120. n = s(r),
  121. i = n.write(t, e);
  122. i !== r && (n = n.slice(0, i));
  123. return n
  124. }(t, e);
  125. if (ArrayBuffer.isView(t)) return f(t);
  126. if (null == t) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + (void 0 === t ? "undefined" : _typeof(t)));
  127. if (x(t, ArrayBuffer) || t && x(t.buffer, ArrayBuffer)) return function(t, e, r) {
  128. if (e < 0 || t.byteLength < e) throw new RangeError('"offset" is outside of buffer bounds');
  129. if (t.byteLength < e + (r || 0)) throw new RangeError('"length" is outside of buffer bounds');
  130. var n;
  131. n = void 0 === e && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, e) : new Uint8Array(t, e, r);
  132. return Object.setPrototypeOf(n, c.prototype), n
  133. }(t, e, r);
  134. if ("number" == typeof t) throw new TypeError('The "value" argument must not be of type number. Received type number');
  135. var n = t.valueOf && t.valueOf();
  136. if (null != n && n !== t) return c.from(n, e, r);
  137. var i = function(t) {
  138. if (c.isBuffer(t)) {
  139. var e = 0 | h(t.length),
  140. r = s(e);
  141. return 0 === r.length || t.copy(r, 0, 0, e), r
  142. }
  143. if (void 0 !== t.length) return "number" != typeof t.length || K(t.length) ? s(0) : f(t);
  144. if ("Buffer" === t.type && Array.isArray(t.data)) return f(t.data)
  145. }(t);
  146. if (i) return i;
  147. if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof t[Symbol.toPrimitive]) return c.from(t[Symbol.toPrimitive]("string"), e, r);
  148. throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + (void 0 === t ? "undefined" : _typeof(t)))
  149. }
  150.  
  151. function u(t) {
  152. if ("number" != typeof t) throw new TypeError('"size" argument must be of type number');
  153. if (t < 0) throw new RangeError('The value "' + t + '" is invalid for option "size"')
  154. }
  155.  
  156. function a(t) {
  157. return u(t), s(t < 0 ? 0 : 0 | h(t))
  158. }
  159.  
  160. function f(t) {
  161. for (var e = t.length < 0 ? 0 : 0 | h(t.length), r = s(e), n = 0; n < e; n += 1) r[n] = 255 & t[n];
  162. return r
  163. }
  164.  
  165. function h(t) {
  166. if (r <= t) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r.toString(16) + " bytes");
  167. return 0 | t
  168. }
  169.  
  170. function l(t, e) {
  171. if (c.isBuffer(t)) return t.length;
  172. if (ArrayBuffer.isView(t) || x(t, ArrayBuffer)) return t.byteLength;
  173. if ("string" != typeof t) throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + (void 0 === t ? "undefined" : _typeof(t)));
  174. var r = t.length,
  175. n = 2 < arguments.length && !0 === arguments[2];
  176. if (!n && 0 === r) return 0;
  177. for (var i = !1;;) switch (e) {
  178. case "ascii":
  179. case "latin1":
  180. case "binary":
  181. return r;
  182. case "utf8":
  183. case "utf-8":
  184. return B(t).length;
  185. case "ucs2":
  186. case "ucs-2":
  187. case "utf16le":
  188. case "utf-16le":
  189. return 2 * r;
  190. case "hex":
  191. return r >>> 1;
  192. case "base64":
  193. return C(t).length;
  194. default:
  195. if (i) return n ? -1 : B(t).length;
  196. e = ("" + e).toLowerCase(), i = !0
  197. }
  198. }
  199.  
  200. function p(t, e, r) {
  201. var n = t[e];
  202. t[e] = t[r], t[r] = n
  203. }
  204.  
  205. function y(t, e, r, n, i) {
  206. if (0 === t.length) return -1;
  207. if ("string" == typeof r ? (n = r, r = 0) : 2147483647 < r ? r = 2147483647 : r < -2147483648 && (r = -2147483648), K(r = +r) && (r = i ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
  208. if (i) return -1;
  209. r = t.length - 1
  210. } else if (r < 0) {
  211. if (!i) return -1;
  212. r = 0
  213. }
  214. if ("string" == typeof e && (e = c.from(e, n)), c.isBuffer(e)) return 0 === e.length ? -1 : d(t, e, r, n, i);
  215. if ("number" == typeof e) return e &= 255, "function" == typeof Uint8Array.prototype.indexOf ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : d(t, [e], r, n, i);
  216. throw new TypeError("val must be string, number or Buffer")
  217. }
  218.  
  219. function d(t, e, r, n, i) {
  220. var o, s = 1,
  221. u = t.length,
  222. a = e.length;
  223. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  224. if (t.length < 2 || e.length < 2) return -1;
  225. u /= s = 2, a /= 2, r /= 2
  226. }
  227.  
  228. function f(t, e) {
  229. return 1 === s ? t[e] : t.readUInt16BE(e * s)
  230. }
  231. if (i) {
  232. var h = -1;
  233. for (o = r; o < u; o++)
  234. if (f(t, o) === f(e, -1 === h ? 0 : o - h)) {
  235. if (-1 === h && (h = o), o - h + 1 === a) return h * s
  236. } else -1 !== h && (o -= o - h), h = -1
  237. } else
  238. for (u < r + a && (r = u - a), o = r; 0 <= o; o--) {
  239. for (var c = !0, l = 0; l < a; l++)
  240. if (f(t, o + l) !== f(e, l)) {
  241. c = !1;
  242. break
  243. } if (c) return o
  244. }
  245. return -1
  246. }
  247.  
  248. function v(t, e, r, n) {
  249. r = Number(r) || 0;
  250. var i = t.length - r;
  251. n ? i < (n = Number(n)) && (n = i) : n = i;
  252. var o = e.length;
  253. o / 2 < n && (n = o / 2);
  254. for (var s = 0; s < n; ++s) {
  255. var u = parseInt(e.substr(2 * s, 2), 16);
  256. if (K(u)) return s;
  257. t[r + s] = u
  258. }
  259. return s
  260. }
  261.  
  262. function g(t, e, r, n) {
  263. return _(function(t) {
  264. for (var e = [], r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));
  265. return e
  266. }(e), t, r, n)
  267. }
  268.  
  269. function w(t, e, r) {
  270. return 0 === e && r === t.length ? n.fromByteArray(t) : n.fromByteArray(t.slice(e, r))
  271. }
  272.  
  273. function b(t, e, r) {
  274. r = Math.min(t.length, r);
  275. for (var n = [], i = e; i < r;) {
  276. var o, s, u, a, f = t[i],
  277. h = null,
  278. c = 239 < f ? 4 : 223 < f ? 3 : 191 < f ? 2 : 1;
  279. if (i + c <= r) switch (c) {
  280. case 1:
  281. f < 128 && (h = f);
  282. break;
  283. case 2:
  284. 128 == (192 & (o = t[i + 1])) && 127 < (a = (31 & f) << 6 | 63 & o) && (h = a);
  285. break;
  286. case 3:
  287. o = t[i + 1], s = t[i + 2], 128 == (192 & o) && 128 == (192 & s) && 2047 < (a = (15 & f) << 12 | (63 & o) << 6 | 63 & s) && (a < 55296 || 57343 < a) && (h = a);
  288. break;
  289. case 4:
  290. o = t[i + 1], s = t[i + 2], u = t[i + 3], 128 == (192 & o) && 128 == (192 & s) && 128 == (192 & u) && 65535 < (a = (15 & f) << 18 | (63 & o) << 12 | (63 & s) << 6 | 63 & u) && a < 1114112 && (h = a)
  291. }
  292. null === h ? (h = 65533, c = 1) : 65535 < h && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), n.push(h), i += c
  293. }
  294. return function(t) {
  295. var e = t.length;
  296. if (e <= E) return String.fromCharCode.apply(String, t);
  297. var r = "",
  298. n = 0;
  299. for (; n < e;) r += String.fromCharCode.apply(String, t.slice(n, n += E));
  300. return r
  301. }(n)
  302. }
  303. R.kMaxLength = r, (c.TYPED_ARRAY_SUPPORT = function() {
  304. try {
  305. var t = new Uint8Array(1),
  306. e = {
  307. foo: function() {
  308. return 42
  309. }
  310. };
  311. return Object.setPrototypeOf(e, Uint8Array.prototype), Object.setPrototypeOf(t, e), 42 === t.foo()
  312. } catch (t) {
  313. return !1
  314. }
  315. }()) || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(c.prototype, "parent", {
  316. enumerable: !0,
  317. get: function() {
  318. if (c.isBuffer(this)) return this.buffer
  319. }
  320. }), Object.defineProperty(c.prototype, "offset", {
  321. enumerable: !0,
  322. get: function() {
  323. if (c.isBuffer(this)) return this.byteOffset
  324. }
  325. }), "undefined" != typeof Symbol && null != Symbol.species && c[Symbol.species] === c && Object.defineProperty(c, Symbol.species, {
  326. value: null,
  327. configurable: !0,
  328. enumerable: !1,
  329. writable: !1
  330. }), c.poolSize = 8192, c.from = function(t, e, r) {
  331. return i(t, e, r)
  332. }, Object.setPrototypeOf(c.prototype, Uint8Array.prototype), Object.setPrototypeOf(c, Uint8Array), c.alloc = function(t, e, r) {
  333. return function(t, e, r) {
  334. return u(t), t <= 0 ? s(t) : void 0 !== e ? "string" == typeof r ? s(t).fill(e, r) : s(t).fill(e) : s(t)
  335. }(t, e, r)
  336. }, c.allocUnsafe = function(t) {
  337. return a(t)
  338. }, c.allocUnsafeSlow = function(t) {
  339. return a(t)
  340. }, c.isBuffer = function(t) {
  341. return null != t && !0 === t._isBuffer && t !== c.prototype
  342. }, c.compare = function(t, e) {
  343. if (x(t, Uint8Array) && (t = c.from(t, t.offset, t.byteLength)), x(e, Uint8Array) && (e = c.from(e, e.offset, e.byteLength)), !c.isBuffer(t) || !c.isBuffer(e)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
  344. if (t === e) return 0;
  345. for (var r = t.length, n = e.length, i = 0, o = Math.min(r, n); i < o; ++i)
  346. if (t[i] !== e[i]) {
  347. r = t[i], n = e[i];
  348. break
  349. } return r < n ? -1 : n < r ? 1 : 0
  350. }, c.isEncoding = function(t) {
  351. switch (String(t).toLowerCase()) {
  352. case "hex":
  353. case "utf8":
  354. case "utf-8":
  355. case "ascii":
  356. case "latin1":
  357. case "binary":
  358. case "base64":
  359. case "ucs2":
  360. case "ucs-2":
  361. case "utf16le":
  362. case "utf-16le":
  363. return !0;
  364. default:
  365. return !1
  366. }
  367. }, c.concat = function(t, e) {
  368. if (!Array.isArray(t)) throw new TypeError('"list" argument must be an Array of Buffers');
  369. if (0 === t.length) return c.alloc(0);
  370. var r;
  371. if (void 0 === e)
  372. for (r = e = 0; r < t.length; ++r) e += t[r].length;
  373. var n = c.allocUnsafe(e),
  374. i = 0;
  375. for (r = 0; r < t.length; ++r) {
  376. var o = t[r];
  377. if (x(o, Uint8Array) && (o = c.from(o)), !c.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers');
  378. o.copy(n, i), i += o.length
  379. }
  380. return n
  381. }, c.byteLength = l, c.prototype._isBuffer = !0, c.prototype.swap16 = function() {
  382. var t = this.length;
  383. if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
  384. for (var e = 0; e < t; e += 2) p(this, e, e + 1);
  385. return this
  386. }, c.prototype.swap32 = function() {
  387. var t = this.length;
  388. if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
  389. for (var e = 0; e < t; e += 4) p(this, e, e + 3), p(this, e + 1, e + 2);
  390. return this
  391. }, c.prototype.swap64 = function() {
  392. var t = this.length;
  393. if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
  394. for (var e = 0; e < t; e += 8) p(this, e, e + 7), p(this, e + 1, e + 6), p(this, e + 2, e + 5), p(this, e + 3, e + 4);
  395. return this
  396. }, c.prototype.toLocaleString = c.prototype.toString = function() {
  397. var t = this.length;
  398. return 0 === t ? "" : 0 === arguments.length ? b(this, 0, t) : function(t, e, r) {
  399. var n = !1;
  400. if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
  401. if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return "";
  402. if ((r >>>= 0) <= (e >>>= 0)) return "";
  403. for (t = t || "utf8";;) switch (t) {
  404. case "hex":
  405. return A(this, e, r);
  406. case "utf8":
  407. case "utf-8":
  408. return b(this, e, r);
  409. case "ascii":
  410. return T(this, e, r);
  411. case "latin1":
  412. case "binary":
  413. return k(this, e, r);
  414. case "base64":
  415. return w(this, e, r);
  416. case "ucs2":
  417. case "ucs-2":
  418. case "utf16le":
  419. case "utf-16le":
  420. return m(this, e, r);
  421. default:
  422. if (n) throw new TypeError("Unknown encoding: " + t);
  423. t = (t + "").toLowerCase(), n = !0
  424. }
  425. }.apply(this, arguments)
  426. }, c.prototype.equals = function(t) {
  427. if (!c.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
  428. return this === t || 0 === c.compare(this, t)
  429. }, c.prototype.inspect = function() {
  430. var t = "",
  431. e = R.INSPECT_MAX_BYTES;
  432. return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">"
  433. }, t && (c.prototype[t] = c.prototype.inspect), c.prototype.compare = function(t, e, r, n, i) {
  434. if (x(t, Uint8Array) && (t = c.from(t, t.offset, t.byteLength)), !c.isBuffer(t)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + (void 0 === t ? "undefined" : _typeof(t)));
  435. if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === n && (n = 0), void 0 === i && (i = this.length), e < 0 || r > t.length || n < 0 || i > this.length) throw new RangeError("out of range index");
  436. if (i <= n && r <= e) return 0;
  437. if (i <= n) return -1;
  438. if (r <= e) return 1;
  439. if (this === t) return 0;
  440. for (var o = (i >>>= 0) - (n >>>= 0), s = (r >>>= 0) - (e >>>= 0), u = Math.min(o, s), a = this.slice(n, i), f = t.slice(e, r), h = 0; h < u; ++h)
  441. if (a[h] !== f[h]) {
  442. o = a[h], s = f[h];
  443. break
  444. } return o < s ? -1 : s < o ? 1 : 0
  445. }, c.prototype.includes = function(t, e, r) {
  446. return -1 !== this.indexOf(t, e, r)
  447. }, c.prototype.indexOf = function(t, e, r) {
  448. return y(this, t, e, r, !0)
  449. }, c.prototype.lastIndexOf = function(t, e, r) {
  450. return y(this, t, e, r, !1)
  451. }, c.prototype.write = function(t, e, r, n) {
  452. if (void 0 === e) n = "utf8", r = this.length, e = 0;
  453. else if (void 0 === r && "string" == typeof e) n = e, r = this.length, e = 0;
  454. else {
  455. if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  456. e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === n && (n = "utf8")) : (n = r, r = void 0)
  457. }
  458. var i = this.length - e;
  459. if ((void 0 === r || i < r) && (r = i), 0 < t.length && (r < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
  460. n = n || "utf8";
  461. for (var o, s, u, a, f, h, c, l, p, y = !1;;) switch (n) {
  462. case "hex":
  463. return v(this, t, e, r);
  464. case "utf8":
  465. case "utf-8":
  466. return l = e, p = r, _(B(t, (c = this).length - l), c, l, p);
  467. case "ascii":
  468. return g(this, t, e, r);
  469. case "latin1":
  470. case "binary":
  471. return g(this, t, e, r);
  472. case "base64":
  473. return a = this, f = e, h = r, _(C(t), a, f, h);
  474. case "ucs2":
  475. case "ucs-2":
  476. case "utf16le":
  477. case "utf-16le":
  478. return s = e, u = r, _(function(t, e) {
  479. for (var r, n, i, o = [], s = 0; s < t.length && !((e -= 2) < 0); ++s) r = t.charCodeAt(s), n = r >> 8, i = r % 256, o.push(i), o.push(n);
  480. return o
  481. }(t, (o = this).length - s), o, s, u);
  482. default:
  483. if (y) throw new TypeError("Unknown encoding: " + n);
  484. n = ("" + n).toLowerCase(), y = !0
  485. }
  486. }, c.prototype.toJSON = function() {
  487. return {
  488. type: "Buffer",
  489. data: Array.prototype.slice.call(this._arr || this, 0)
  490. }
  491. };
  492. var E = 4096;
  493.  
  494. function T(t, e, r) {
  495. var n = "";
  496. r = Math.min(t.length, r);
  497. for (var i = e; i < r; ++i) n += String.fromCharCode(127 & t[i]);
  498. return n
  499. }
  500.  
  501. function k(t, e, r) {
  502. var n = "";
  503. r = Math.min(t.length, r);
  504. for (var i = e; i < r; ++i) n += String.fromCharCode(t[i]);
  505. return n
  506. }
  507.  
  508. function A(t, e, r) {
  509. var n = t.length;
  510. (!e || e < 0) && (e = 0), (!r || r < 0 || n < r) && (r = n);
  511. for (var i = "", o = e; o < r; ++o) i += N(t[o]);
  512. return i
  513. }
  514.  
  515. function m(t, e, r) {
  516. for (var n = t.slice(e, r), i = "", o = 0; o < n.length; o += 2) i += String.fromCharCode(n[o] + 256 * n[o + 1]);
  517. return i
  518. }
  519.  
  520. function U(t, e, r) {
  521. if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
  522. if (r < t + e) throw new RangeError("Trying to access beyond buffer length")
  523. }
  524.  
  525. function O(t, e, r, n, i, o) {
  526. if (!c.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
  527. if (i < e || e < o) throw new RangeError('"value" argument is out of bounds');
  528. if (r + n > t.length) throw new RangeError("Index out of range")
  529. }
  530.  
  531. function I(t, e, r, n) {
  532. if (r + n > t.length) throw new RangeError("Index out of range");
  533. if (r < 0) throw new RangeError("Index out of range")
  534. }
  535.  
  536. function P(t, e, r, n, i) {
  537. return e = +e, r >>>= 0, i || I(t, 0, r, 4), o.write(t, e, r, n, 23, 4), r + 4
  538. }
  539.  
  540. function S(t, e, r, n, i) {
  541. return e = +e, r >>>= 0, i || I(t, 0, r, 8), o.write(t, e, r, n, 52, 8), r + 8
  542. }
  543. c.prototype.slice = function(t, e) {
  544. var r = this.length;
  545. (t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : r < t && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : r < e && (e = r), e < t && (e = t);
  546. var n = this.subarray(t, e);
  547. return Object.setPrototypeOf(n, c.prototype), n
  548. }, c.prototype.readUIntLE = function(t, e, r) {
  549. t >>>= 0, e >>>= 0, r || U(t, e, this.length);
  550. for (var n = this[t], i = 1, o = 0; ++o < e && (i *= 256);) n += this[t + o] * i;
  551. return n
  552. }, c.prototype.readUIntBE = function(t, e, r) {
  553. t >>>= 0, e >>>= 0, r || U(t, e, this.length);
  554. for (var n = this[t + --e], i = 1; 0 < e && (i *= 256);) n += this[t + --e] * i;
  555. return n
  556. }, c.prototype.readUInt8 = function(t, e) {
  557. return t >>>= 0, e || U(t, 1, this.length), this[t]
  558. }, c.prototype.readUInt16LE = function(t, e) {
  559. return t >>>= 0, e || U(t, 2, this.length), this[t] | this[t + 1] << 8
  560. }, c.prototype.readUInt16BE = function(t, e) {
  561. return t >>>= 0, e || U(t, 2, this.length), this[t] << 8 | this[t + 1]
  562. }, c.prototype.readUInt32LE = function(t, e) {
  563. return t >>>= 0, e || U(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
  564. }, c.prototype.readUInt32BE = function(t, e) {
  565. return t >>>= 0, e || U(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
  566. }, c.prototype.readIntLE = function(t, e, r) {
  567. t >>>= 0, e >>>= 0, r || U(t, e, this.length);
  568. for (var n = this[t], i = 1, o = 0; ++o < e && (i *= 256);) n += this[t + o] * i;
  569. return (i *= 128) <= n && (n -= Math.pow(2, 8 * e)), n
  570. }, c.prototype.readIntBE = function(t, e, r) {
  571. t >>>= 0, e >>>= 0, r || U(t, e, this.length);
  572. for (var n = e, i = 1, o = this[t + --n]; 0 < n && (i *= 256);) o += this[t + --n] * i;
  573. return (i *= 128) <= o && (o -= Math.pow(2, 8 * e)), o
  574. }, c.prototype.readInt8 = function(t, e) {
  575. return t >>>= 0, e || U(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
  576. }, c.prototype.readInt16LE = function(t, e) {
  577. t >>>= 0, e || U(t, 2, this.length);
  578. var r = this[t] | this[t + 1] << 8;
  579. return 32768 & r ? 4294901760 | r : r
  580. }, c.prototype.readInt16BE = function(t, e) {
  581. t >>>= 0, e || U(t, 2, this.length);
  582. var r = this[t + 1] | this[t] << 8;
  583. return 32768 & r ? 4294901760 | r : r
  584. }, c.prototype.readInt32LE = function(t, e) {
  585. return t >>>= 0, e || U(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
  586. }, c.prototype.readInt32BE = function(t, e) {
  587. return t >>>= 0, e || U(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
  588. }, c.prototype.readFloatLE = function(t, e) {
  589. return t >>>= 0, e || U(t, 4, this.length), o.read(this, t, !0, 23, 4)
  590. }, c.prototype.readFloatBE = function(t, e) {
  591. return t >>>= 0, e || U(t, 4, this.length), o.read(this, t, !1, 23, 4)
  592. }, c.prototype.readDoubleLE = function(t, e) {
  593. return t >>>= 0, e || U(t, 8, this.length), o.read(this, t, !0, 52, 8)
  594. }, c.prototype.readDoubleBE = function(t, e) {
  595. return t >>>= 0, e || U(t, 8, this.length), o.read(this, t, !1, 52, 8)
  596. }, c.prototype.writeUIntLE = function(t, e, r, n) {
  597. t = +t, e >>>= 0, r >>>= 0, n || O(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
  598. var i = 1,
  599. o = 0;
  600. for (this[e] = 255 & t; ++o < r && (i *= 256);) this[e + o] = t / i & 255;
  601. return e + r
  602. }, c.prototype.writeUIntBE = function(t, e, r, n) {
  603. t = +t, e >>>= 0, r >>>= 0, n || O(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
  604. var i = r - 1,
  605. o = 1;
  606. for (this[e + i] = 255 & t; 0 <= --i && (o *= 256);) this[e + i] = t / o & 255;
  607. return e + r
  608. }, c.prototype.writeUInt8 = function(t, e, r) {
  609. return t = +t, e >>>= 0, r || O(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1
  610. }, c.prototype.writeUInt16LE = function(t, e, r) {
  611. return t = +t, e >>>= 0, r || O(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2
  612. }, c.prototype.writeUInt16BE = function(t, e, r) {
  613. return t = +t, e >>>= 0, r || O(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2
  614. }, c.prototype.writeUInt32LE = function(t, e, r) {
  615. return t = +t, e >>>= 0, r || O(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t, e + 4
  616. }, c.prototype.writeUInt32BE = function(t, e, r) {
  617. return t = +t, e >>>= 0, r || O(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4
  618. }, c.prototype.writeIntLE = function(t, e, r, n) {
  619. if (t = +t, e >>>= 0, !n) {
  620. var i = Math.pow(2, 8 * r - 1);
  621. O(this, t, e, r, i - 1, -i)
  622. }
  623. var o = 0,
  624. s = 1,
  625. u = 0;
  626. for (this[e] = 255 & t; ++o < r && (s *= 256);) t < 0 && 0 === u && 0 !== this[e + o - 1] && (u = 1), this[e + o] = (t / s >> 0) - u & 255;
  627. return e + r
  628. }, c.prototype.writeIntBE = function(t, e, r, n) {
  629. if (t = +t, e >>>= 0, !n) {
  630. var i = Math.pow(2, 8 * r - 1);
  631. O(this, t, e, r, i - 1, -i)
  632. }
  633. var o = r - 1,
  634. s = 1,
  635. u = 0;
  636. for (this[e + o] = 255 & t; 0 <= --o && (s *= 256);) t < 0 && 0 === u && 0 !== this[e + o + 1] && (u = 1), this[e + o] = (t / s >> 0) - u & 255;
  637. return e + r
  638. }, c.prototype.writeInt8 = function(t, e, r) {
  639. return t = +t, e >>>= 0, r || O(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1
  640. }, c.prototype.writeInt16LE = function(t, e, r) {
  641. return t = +t, e >>>= 0, r || O(this, t, e, 2, 32767, -32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2
  642. }, c.prototype.writeInt16BE = function(t, e, r) {
  643. return t = +t, e >>>= 0, r || O(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2
  644. }, c.prototype.writeInt32LE = function(t, e, r) {
  645. return t = +t, e >>>= 0, r || O(this, t, e, 4, 2147483647, -2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4
  646. }, c.prototype.writeInt32BE = function(t, e, r) {
  647. return t = +t, e >>>= 0, r || O(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4
  648. }, c.prototype.writeFloatLE = function(t, e, r) {
  649. return P(this, t, e, !0, r)
  650. }, c.prototype.writeFloatBE = function(t, e, r) {
  651. return P(this, t, e, !1, r)
  652. }, c.prototype.writeDoubleLE = function(t, e, r) {
  653. return S(this, t, e, !0, r)
  654. }, c.prototype.writeDoubleBE = function(t, e, r) {
  655. return S(this, t, e, !1, r)
  656. }, c.prototype.copy = function(t, e, r, n) {
  657. if (!c.isBuffer(t)) throw new TypeError("argument should be a Buffer");
  658. if (r = r || 0, n || 0 === n || (n = this.length), e >= t.length && (e = t.length), e = e || 0, 0 < n && n < r && (n = r), n === r) return 0;
  659. if (0 === t.length || 0 === this.length) return 0;
  660. if (e < 0) throw new RangeError("targetStart out of bounds");
  661. if (r < 0 || r >= this.length) throw new RangeError("Index out of range");
  662. if (n < 0) throw new RangeError("sourceEnd out of bounds");
  663. n > this.length && (n = this.length), t.length - e < n - r && (n = t.length - e + r);
  664. var i = n - r;
  665. if (this === t && "function" == typeof Uint8Array.prototype.copyWithin) this.copyWithin(e, r, n);
  666. else if (this === t && r < e && e < n)
  667. for (var o = i - 1; 0 <= o; --o) t[o + e] = this[o + r];
  668. else Uint8Array.prototype.set.call(t, this.subarray(r, n), e);
  669. return i
  670. }, c.prototype.fill = function(t, e, r, n) {
  671. if ("string" == typeof t) {
  672. if ("string" == typeof e ? (n = e, e = 0, r = this.length) : "string" == typeof r && (n = r, r = this.length), void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string");
  673. if ("string" == typeof n && !c.isEncoding(n)) throw new TypeError("Unknown encoding: " + n);
  674. if (1 === t.length) {
  675. var i = t.charCodeAt(0);
  676. ("utf8" === n && i < 128 || "latin1" === n) && (t = i)
  677. }
  678. } else "number" == typeof t && (t &= 255);
  679. if (e < 0 || this.length < e || this.length < r) throw new RangeError("Out of range index");
  680. if (r <= e) return this;
  681. var o;
  682. if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, "number" == typeof(t = t || 0))
  683. for (o = e; o < r; ++o) this[o] = t;
  684. else {
  685. var s = c.isBuffer(t) ? t : c.from(t, n),
  686. u = s.length;
  687. if (0 === u) throw new TypeError('The value "' + t + '" is invalid for argument "value"');
  688. for (o = 0; o < r - e; ++o) this[o + e] = s[o % u]
  689. }
  690. return this
  691. };
  692. var e = /[^+/0-9A-Za-z-_]/g;
  693.  
  694. function N(t) {
  695. return t < 16 ? "0" + t.toString(16) : t.toString(16)
  696. }
  697.  
  698. function B(t, e) {
  699. var r;
  700. e = e || 1 / 0;
  701. for (var n = t.length, i = null, o = [], s = 0; s < n; ++s) {
  702. if (55295 < (r = t.charCodeAt(s)) && r < 57344) {
  703. if (!i) {
  704. if (56319 < r) {
  705. -1 < (e -= 3) && o.push(239, 191, 189);
  706. continue
  707. }
  708. if (s + 1 === n) {
  709. -1 < (e -= 3) && o.push(239, 191, 189);
  710. continue
  711. }
  712. i = r;
  713. continue
  714. }
  715. if (r < 56320) {
  716. -1 < (e -= 3) && o.push(239, 191, 189), i = r;
  717. continue
  718. }
  719. r = 65536 + (i - 55296 << 10 | r - 56320)
  720. } else i && -1 < (e -= 3) && o.push(239, 191, 189);
  721. if (i = null, r < 128) {
  722. if ((e -= 1) < 0) break;
  723. o.push(r)
  724. } else if (r < 2048) {
  725. if ((e -= 2) < 0) break;
  726. o.push(r >> 6 | 192, 63 & r | 128)
  727. } else if (r < 65536) {
  728. if ((e -= 3) < 0) break;
  729. o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128)
  730. } else {
  731. if (!(r < 1114112)) throw new Error("Invalid code point");
  732. if ((e -= 4) < 0) break;
  733. o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128)
  734. }
  735. }
  736. return o
  737. }
  738.  
  739. function C(t) {
  740. return n.toByteArray(function(t) {
  741. if ((t = (t = t.split("=")[0]).trim().replace(e, "")).length < 2) return "";
  742. for (; t.length % 4 != 0;) t += "=";
  743. return t
  744. }(t))
  745. }
  746.  
  747. function _(t, e, r, n) {
  748. for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i) e[i + r] = t[i];
  749. return i
  750. }
  751.  
  752. function x(t, e) {
  753. return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name
  754. }
  755.  
  756. function K(t) {
  757. return t != t
  758. }
  759. }).call(this, L("buffer").Buffer)
  760. }, {
  761. "base64-js": 1,
  762. buffer: 2,
  763. ieee754: 3
  764. }],
  765. 3: [function(t, e, r) {
  766. r.read = function(t, e, r, n, i) {
  767. var o, s, u = 8 * i - n - 1,
  768. a = (1 << u) - 1,
  769. f = a >> 1,
  770. h = -7,
  771. c = r ? i - 1 : 0,
  772. l = r ? -1 : 1,
  773. p = t[e + c];
  774. for (c += l, o = p & (1 << -h) - 1, p >>= -h, h += u; 0 < h; o = 256 * o + t[e + c], c += l, h -= 8);
  775. for (s = o & (1 << -h) - 1, o >>= -h, h += n; 0 < h; s = 256 * s + t[e + c], c += l, h -= 8);
  776. if (0 === o) o = 1 - f;
  777. else {
  778. if (o === a) return s ? NaN : 1 / 0 * (p ? -1 : 1);
  779. s += Math.pow(2, n), o -= f
  780. }
  781. return (p ? -1 : 1) * s * Math.pow(2, o - n)
  782. }, r.write = function(t, e, r, n, i, o) {
  783. var s, u, a, f = 8 * o - i - 1,
  784. h = (1 << f) - 1,
  785. c = h >> 1,
  786. l = 23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  787. p = n ? 0 : o - 1,
  788. y = n ? 1 : -1,
  789. d = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
  790. for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (u = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (a = Math.pow(2, -s)) < 1 && (s--, a *= 2), 2 <= (e += 1 <= s + c ? l / a : l * Math.pow(2, 1 - c)) * a && (s++, a /= 2), h <= s + c ? (u = 0, s = h) : 1 <= s + c ? (u = (e * a - 1) * Math.pow(2, i), s += c) : (u = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); 8 <= i; t[r + p] = 255 & u, p += y, u /= 256, i -= 8);
  791. for (s = s << i | u, f += i; 0 < f; t[r + p] = 255 & s, p += y, s /= 256, f -= 8);
  792. t[r + p - y] |= 128 * d
  793. }
  794. }, {}],
  795. 4: [function(t, e, r) {
  796. var n = {
  797. objPosX: 3,
  798. objPosY: 1,
  799. objAngle: 2,
  800. agentPosX: 66,
  801. agentPosY: 23,
  802. agentPosX2: 18,
  803. agentPosY2: 44,
  804. fade: 64,
  805. opacity: 65,
  806. counter: 29,
  807. weirdBytes1: 19,
  808. weirdBytes2: 29,
  809. expPointsOthert: 20,
  810. maxHealth: 35,
  811. health: 37,
  812. timeAliveThis: 28,
  813. tankMass: 25,
  814. tankSpeed: 31,
  815. tankLevel: 38,
  816. expPointsThis: 39
  817. },
  818. i = {},
  819. o = !0,
  820. s = !1,
  821. u = void 0;
  822. try {
  823. for (var a, f = Object.keys(n)[Symbol.iterator](); !(o = (a = f.next()).done); o = !0) {
  824. var h = a.value;
  825. i[n[h]] = h
  826. }
  827. } catch (t) {
  828. s = !0, u = t
  829. } finally {
  830. try {
  831. !o && f.return && f.return()
  832. } finally {
  833. if (s) throw u
  834. }
  835. }
  836. var c = {
  837. LEFT_MOUSE: 1,
  838. UP: 2,
  839. LEFT: 4,
  840. DOWN: 8,
  841. RIGHT: 16,
  842. GOD_MODE: 32,
  843. SUICIDE: 64,
  844. RIGHT_MOUSE: 128,
  845. INSTANT_UPGRADE: 256,
  846. USE_GAMEPAD: 512,
  847. SWITCH_CLASS: 1024,
  848. TRUE_CONST: 2048
  849. },
  850. l = {
  851. UP: c.UP,
  852. RIGHT_UP: c.RIGHT | c.UP,
  853. RIGHT: c.RIGHT,
  854. RIGHT_DOWN: c.RIGHT | c.DOWN,
  855. DOWN: c.DOWN,
  856. LEFT_DOWN: c.LEFT | c.DOWN,
  857. LEFT: c.LEFT,
  858. LEFT_UP: c.LEFT | c.UP
  859. },
  860. p = (_createClass(y, [{
  861. key: "get",
  862. value: function(t) {
  863. return this.lookup[t]
  864. }
  865. }, {
  866. key: "find",
  867. value: function(t) {
  868. if (!this.reverse.hasOwnProperty(t)) throw t;
  869. return this.reverse[t]
  870. }
  871. }]), y);
  872.  
  873. function y() {
  874. var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [],
  875. e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
  876. _classCallCheck(this, y);
  877. var r = "function" === e ? e : function(t) {
  878. return t ^ e
  879. };
  880. this.table = t, this.length = t.length, this.lookup = {}, this.reverse = {};
  881. for (var n = 0; n < t.length; n++) this.lookup[r(n)] = t[n], this.reverse[t[n]] = r(n)
  882. }
  883. var d = new p([8, 7, 6, 5, 4, 3, 2, 1], 0),
  884. v = new p(["Tank", "Twin", "Triplet", "Triple Shot", "Quad Tank", "Octo Tank", "Sniper", "Machine Gun", "Flank Guard", "Tri-Angle", "Destroyer", "Overseer", "Overlord", "Twin-Flank", "Penta Shot", "Assassin", "Arena Closer", "Necromancer", "Triple Twin", "Hunter", "Gunner", "Stalker", "Ranger", "Booster", "Fighter", "Hybrid", "Manager", "Mothership", "Predator", "Sprayer", "", "Trapper", "Gunner Trapper", "Overtrapper", "Mega Trapper", "Tri-Trapper", "Smasher", "", "Landmine", "Auto Gunner", "Auto 5", "Auto 3", "Spread Shot", "Streamliner", "Auto Trapper", "Dominator", "Dominator", "Dominator", "Battleship", "Annihilator", "Auto Smasher", "Spike", "Factory", "", "Skimmer", "Rocketeer"], 0);
  885. e.exports = {
  886. updateKinds: {
  887. CREATE: 1,
  888. UPDATE: 2
  889. },
  890. inPacketKinds: {
  891. UPDATE: 0,
  892. UPDATE_COMPRESSED: 2,
  893. IGNORE: -1
  894. },
  895. entityTypes: {
  896. UNKNOWN: "UNKNOWN",
  897. TANK: "TANK",
  898. BULLET: "BULLET",
  899. SHAPE: "SHAPE",
  900. BOT: "BOT",
  901. OWN_TANK: "OWN_TANK",
  902. LEADER_TANK: "LEADER_TANK",
  903. MASTER_TANK: "MASTER_TANK"
  904. },
  905. fieldIdToType: {
  906. 1: "vi",
  907. 2: "vi",
  908. 3: "vi",
  909. 23: "float",
  910. 66: "float",
  911. 18: "float",
  912. 44: "float",
  913. 64: "float",
  914. 65: "float",
  915. 29: "float",
  916. 19: "vu",
  917. 57: "vu",
  918. 20: "float",
  919. 35: "float",
  920. 37: "float",
  921. 28: "float",
  922. 25: "vi",
  923. 26: "float",
  924. 27: "float",
  925. 31: "float",
  926. 38: "vi",
  927. 39: "float",
  928. 59: "float",
  929. 63: "vu",
  930. 67: "vu",
  931. 53: "vu"
  932. },
  933. fieldIdToName: i,
  934. tankTable: v,
  935. statTable: d,
  936. outPacketKinds: {
  937. INIT: 0,
  938. INPUT: 1,
  939. SPAWN: 2,
  940. UPDATE_STAT: 3,
  941. UPDATE_TANK: 4,
  942. HEARTBEAT: 5,
  943. UNKNOWN: 6,
  944. EXT_FOUND: 7,
  945. CLEAR_DEATH: 8,
  946. TAKE_TANK: 9
  947. },
  948. keyInput: c,
  949. directionAccelerations: {
  950. UP: {
  951. x: 0,
  952. y: -1
  953. },
  954. RIGHT_UP: {
  955. x: .707,
  956. y: -.707
  957. },
  958. RIGHT: {
  959. x: 1,
  960. y: 0
  961. },
  962. RIGHT_DOWN: {
  963. x: .707,
  964. y: .707
  965. },
  966. DOWN: {
  967. x: 0,
  968. y: 1
  969. },
  970. LEFT_DOWN: {
  971. x: -.707,
  972. y: .707
  973. },
  974. LEFT: {
  975. x: -1,
  976. y: 0
  977. },
  978. LEFT_UP: {
  979. x: -.707,
  980. y: -.707
  981. }
  982. },
  983. directionKeys: l
  984. }
  985. }, {}],
  986. 5: [function(a, f, t) {
  987. (function(r) {
  988. var e = a("./data.js"),
  989. t = new ArrayBuffer(4),
  990. n = new Uint8Array(t),
  991. i = new Uint32Array(t),
  992. o = new Float32Array(t),
  993. s = (_createClass(u, [{
  994. key: "i8",
  995. value: function(t) {
  996. return this.buffer[this.length] = t, this.length += 1, this
  997. }
  998. }, {
  999. key: "i32",
  1000. value: function(t) {
  1001. return i[0] = t, this.buffer.set(n, this.length), this.length += 4, this
  1002. }
  1003. }, {
  1004. key: "float",
  1005. value: function(t) {
  1006. return o[0] = t, this.buffer.set(n, this.length), this.length += 4, this
  1007. }
  1008. }, {
  1009. key: "vu",
  1010. value: function(t) {
  1011. do {
  1012. var e = t;
  1013. (t >>>= 7) && (e |= 128), this.buffer[this.length++] = e
  1014. } while (t);
  1015. return this
  1016. }
  1017. }, {
  1018. key: "vi",
  1019. value: function(t) {
  1020. var e = (2147483648 & t) >>> 31;
  1021. e && (t = ~t);
  1022. var r = t << 1 | e;
  1023. return this.vu(r), this
  1024. }
  1025. }, {
  1026. key: "vf",
  1027. value: function(t) {
  1028. return o[0] = t, this.vi(function(t) {
  1029. return (255 & t) << 24 | (65280 & t) << 8 | t >> 8 & 65280 | t >> 24 & 255
  1030. }(i[0])), this
  1031. }
  1032. }, {
  1033. key: "string",
  1034. value: function(t) {
  1035. if (t) {
  1036. var e = new Uint8Array(r.from(t));
  1037. this.buffer.set(e, this.length), this.length += e.length
  1038. }
  1039. return this.buffer[this.length++] = 0, this
  1040. }
  1041. }, {
  1042. key: "out",
  1043. value: function() {
  1044. return this.buffer.buffer.slice(0, this.length)
  1045. }
  1046. }, {
  1047. key: "dump",
  1048. value: function() {
  1049. return Array.from(this.buffer.subarray(0, this.length)).map(function(t) {
  1050. return t.toString(16).padStart(2, 0)
  1051. }).join(" ")
  1052. }
  1053. }, {
  1054. key: "encodeOutbound",
  1055. value: function(t) {
  1056. switch (t.kind) {
  1057. case e.outPacketKinds.INIT:
  1058. return this.encodeInit(t);
  1059. case e.outPacketKinds.INPUT:
  1060. return this.encodeInput(t);
  1061. case e.outPacketKinds.SPAWN:
  1062. return this.encodeSpawn(t);
  1063. case e.outPacketKinds.UPDATE_STAT:
  1064. return this.encodeUpdateStat(t);
  1065. case e.outPacketKinds.UPDATE_TANK:
  1066. return this.encodeUpdateTank(t);
  1067. case e.outPacketKinds.EXT_FOUND:
  1068. return !1;
  1069. default:
  1070. return t.data ? t.data : this.vu(t.kind).out()
  1071. }
  1072. }
  1073. }, {
  1074. key: "encodeInput",
  1075. value: function(t) {
  1076. return this.vu(t.kind).vu(t.key).vf(t.x).vf(t.y).out()
  1077. }
  1078. }, {
  1079. key: "encodeInit",
  1080. value: function(t) {
  1081. return this.vu(t.kind).string(t.build).string(t.unk1).string(t.partyId).string(t.unk2).out()
  1082. }
  1083. }, {
  1084. key: "encodeSpawn",
  1085. value: function(t) {
  1086. return this.vu(t.kind).string(t.name).out()
  1087. }
  1088. }, {
  1089. key: "encodeUpdateStat",
  1090. value: function(t) {
  1091. return this.vu(t.kind).vu(t.statId).vu(t.upto).out()
  1092. }
  1093. }, {
  1094. key: "encodeUpdateTank",
  1095. value: function(t) {
  1096. return this.vu(t.kind).vu(t.tankId).out()
  1097. }
  1098. }]), u);
  1099.  
  1100. function u() {
  1101. _classCallCheck(this, u), this.length = 0, this.buffer = new Uint8Array(4096)
  1102. }
  1103. f.exports = {
  1104. Encoder: s
  1105. }
  1106. }).call(this, a("buffer").Buffer)
  1107. }, {
  1108. "./data.js": 4,
  1109. buffer: 2
  1110. }],
  1111. 6: [function(t, e, r) {
  1112. e.exports = {
  1113. inject: function(n, i) {
  1114. var o = new Set,
  1115. s = window.WebSocket.prototype.send;
  1116. return window.WebSocket.prototype.send = function(t) {
  1117. var e = new Uint8Array(t);
  1118. if (!o.has(this)) {
  1119. console.log("Hello: New WebSocket is being used."), o.add(this);
  1120. var r = this.onmessage;
  1121. this.onmessage = function(t) {
  1122. if (n && (t.data = n.call(this, new Uint8Array(t.data))), t.data) return r.call(this, t)
  1123. }
  1124. }
  1125. try {
  1126. i && (e = i.call(this, e))
  1127. } catch (t) {
  1128. console.log("Test Injection")
  1129. }
  1130. if (e) return s.call(this, e)
  1131. }, console.log("injection ok"), s
  1132. }
  1133. }
  1134. }, {}],
  1135. 7: [function(t, e, r) {
  1136. var n = t("./data.js"),
  1137. i = new ArrayBuffer(4),
  1138. o = new Uint8Array(i),
  1139. s = new Uint32Array(i),
  1140. u = new Float32Array(i),
  1141. a = (_createClass(f, [{
  1142. key: "i8",
  1143. value: function() {
  1144. var t = this.buffer[this.at++];
  1145. return this.assertNotOOB(), t
  1146. }
  1147. }, {
  1148. key: "endianSwap",
  1149. value: function(t) {
  1150. return (255 & t) << 24 | (65280 & t) << 8 | t >> 8 & 65280 | t >> 24 & 255
  1151. }
  1152. }, {
  1153. key: "i32",
  1154. value: function() {
  1155. return o.set(this.buffer.subarray(this.at, this.at += 4)), this.assertNotOOB(), s[0]
  1156. }
  1157. }, {
  1158. key: "float",
  1159. value: function() {
  1160. return o.set(this.buffer.subarray(this.at, this.at += 4)), this.assertNotOOB(), u[0]
  1161. }
  1162. }, {
  1163. key: "vleft",
  1164. value: function() {
  1165. this.at--;
  1166. for (var t = 1; 128 & this.buffer[this.at - 1] && t < 4;) this.at--, t++
  1167. }
  1168. }, {
  1169. key: "vu",
  1170. value: function() {
  1171. for (var t = 0, e = 0; 128 & this.buffer[this.at];) t |= (127 & this.buffer[this.at++]) << e, e += 7;
  1172. return t |= this.buffer[this.at++] << e, this.assertNotOOB(), t
  1173. }
  1174. }, {
  1175. key: "vi",
  1176. value: function() {
  1177. var t = this.vu(),
  1178. e = 1 & t;
  1179. return t >>= 1, e && (t = ~t), this.assertNotOOB(), t
  1180. }
  1181. }, {
  1182. key: "vf",
  1183. value: function() {
  1184. return s[0] = this.endianSwap(this.vi()), this.assertNotOOB(), u[0]
  1185. }
  1186. }, {
  1187. key: "string",
  1188. value: function() {
  1189. for (var t = ""; this.buffer[this.at];) t += String.fromCharCode(this.buffer[this.at]), this.at++;
  1190. return this.at++, this.assertNotOOB(), t
  1191. }
  1192. }, {
  1193. key: "getByteString",
  1194. value: function(t, e) {
  1195. for (var r = ""; t < e && t < this.buffer.length;) {
  1196. var n = this.buffer[t];
  1197. r += (n < 16 ? "0" : "") + n.toString(16) + " ", t++
  1198. }
  1199. return r
  1200. }
  1201. }, {
  1202. key: "isEOF",
  1203. value: function() {
  1204. return this.at === this.buffer.length
  1205. }
  1206. }, {
  1207. key: "raiseUnexpected",
  1208. value: function(t, e) {
  1209. var r = "Error at pos " + this.at + ": " + t;
  1210. "tolerate" !== e && console.log(" ");
  1211. var n = new Error(r);
  1212. throw n.payload = e, n
  1213. }
  1214. }, {
  1215. key: "assertEOF",
  1216. value: function() {
  1217. this.isEOF() || this.raiseUnexpected("Expected end of packet.")
  1218. }
  1219. }, {
  1220. key: "assertNotOOB",
  1221. value: function() {
  1222. this.at > this.buffer.length && this.raiseUnexpected("Unexpected end of packet.")
  1223. }
  1224. }, {
  1225. key: "assertNoIntersectingKeys",
  1226. value: function(t, e) {}
  1227. }, {
  1228. key: "parseOutbound",
  1229. value: function() {
  1230. var t = this.i8();
  1231. switch (t) {
  1232. case n.outPacketKinds.INIT:
  1233. return this.parseInit();
  1234. case n.outPacketKinds.INPUT:
  1235. return this.parseInput();
  1236. case n.outPacketKinds.SPAWN:
  1237. return this.parseSpawn();
  1238. case n.outPacketKinds.UPDATE_STAT:
  1239. return this.parseUpdateStat();
  1240. case n.outPacketKinds.UPDATE_TANK:
  1241. return this.parseUpdateTank();
  1242. default:
  1243. return {
  1244. kind: t, data: this.buffer
  1245. }
  1246. }
  1247. }
  1248. }, {
  1249. key: "parseInput",
  1250. value: function() {
  1251. var t = {
  1252. kind: n.outPacketKinds.INPUT,
  1253. key: this.vu(),
  1254. x: this.vf(),
  1255. y: this.vf()
  1256. };
  1257. return this.isEOF() || console.log("Unexpected end of output 'input' packet."), this.assertEOF(), t
  1258. }
  1259. }, {
  1260. key: "parseInit",
  1261. value: function() {
  1262. if (this.isEOF()) return {
  1263. kind: n.outPacketKinds.INIT
  1264. };
  1265. var t = {
  1266. kind: n.outPacketKinds.INIT,
  1267. build: this.string(),
  1268. unk1: this.string(),
  1269. partyId: this.string(),
  1270. unk2: this.string()
  1271. };
  1272. return this.assertEOF(), t
  1273. }
  1274. }, {
  1275. key: "parseSpawn",
  1276. value: function() {
  1277. var t = {
  1278. kind: n.outPacketKinds.SPAWN,
  1279. name: this.string()
  1280. };
  1281. return this.assertEOF(), t
  1282. }
  1283. }, {
  1284. key: "parseUpdateStat",
  1285. value: function() {
  1286. var t = {
  1287. kind: n.outPacketKinds.UPDATE_STAT,
  1288. statId: this.vu(),
  1289. upto: this.vu()
  1290. };
  1291. return this.assertEOF(), t
  1292. }
  1293. }, {
  1294. key: "parseUpdateTank",
  1295. value: function() {
  1296. var t = {
  1297. kind: n.outPacketKinds.UPDATE_TANK,
  1298. tankId: this.vu()
  1299. };
  1300. return this.assertEOF(), t
  1301. }
  1302. }, {
  1303. key: "parseInbound",
  1304. value: function() {
  1305. var t = this.i8();
  1306. return t === n.inPacketKinds.UPDATE ? this.buffer.length < 2 ? this.ignorePacket("?") : this.updatePacket() : t === n.inPacketKinds.UPDATE_COMPRESSED ? this.updateCompressedPacket() : this.ignorePacket(t)
  1307. }
  1308. }, {
  1309. key: "updatePacket",
  1310. value: function() {
  1311. var t = this.vu(),
  1312. e = {
  1313. kind: n.inPacketKinds.UPDATE,
  1314. updateId: t,
  1315. deletes: this.multiEntityDeletes(),
  1316. upcreates: this.multiEntityUpcreates()
  1317. };
  1318. return this.assertEOF(), e
  1319. }
  1320. }, {
  1321. key: "updateCompressedPacket",
  1322. value: function() {
  1323. this.raiseUnexpected("UPDATE_COMPRESSED not supported", "compressed")
  1324. }
  1325. }, {
  1326. key: "ignorePacket",
  1327. value: function(t) {
  1328. return {
  1329. kind: n.inPacketKinds.IGNORE,
  1330. ignore_reason: t
  1331. }
  1332. }
  1333. }, {
  1334. key: "entityId",
  1335. value: function() {
  1336. var t = this.vu() + "#" + this.vu();
  1337. return this.curEntityId = t
  1338. }
  1339. }, {
  1340. key: "isMatch",
  1341. value: function(t) {
  1342. if (this.at + t.length > this.buffer.length) return !1;
  1343. for (var e = 0; e < t.length; e++)
  1344. if (this.buffer[e + this.at] !== t[e]) return !1;
  1345. return !0
  1346. }
  1347. }, {
  1348. key: "moveToNextCreate",
  1349. value: function() {
  1350. for (; ++this.at < this.buffer.length;)
  1351. if (this.entityCreateTypeId() !== n.entityTypes.UNKNOWN && 0 === this.buffer[this.at - 1] && 1 === this.buffer[this.at - 2]) return this.vleft(), this.vleft(), this.vleft(), void this.vleft();
  1352. this.assertEOF()
  1353. }
  1354. }, {
  1355. key: "entityCreateTypeId",
  1356. value: function() {
  1357. return this.isMatch([2, 0, 5, 3, 0, 3]) ? n.entityTypes.TANK : this.isMatch([2, 0, 7, 0, 1]) ? n.entityTypes.BULLET : this.isMatch([2, 0, 5, 3, 0, 1]) ? n.entityTypes.SHAPE : n.entityTypes.UNKNOWN
  1358. }
  1359. }, {
  1360. key: "fieldIdSpec",
  1361. value: function() {
  1362. return 1 ^ this.vu()
  1363. }
  1364. }, {
  1365. key: "updateKind",
  1366. value: function() {
  1367. var t = this.vu(),
  1368. e = this.vu();
  1369. return 1 === t && 0 === e ? n.updateKinds.CREATE : 0 === t && 1 === e ? n.updateKinds.UPDATE : (console.log(), void this.raiseUnexpected("Unknown update type: " + t + " " + e, 9 === e ? "tolerate" : null))
  1370. }
  1371. }, {
  1372. key: "multiEntityDeletes",
  1373. value: function() {
  1374. for (var t = this.vu(), e = [], r = 0; r < t; r++) e.push(this.entityId());
  1375. return e
  1376. }
  1377. }, {
  1378. key: "multiEntityUpcreates",
  1379. value: function() {
  1380. for (var t = this.vu(), e = [], r = 0; r < t; r++) {
  1381. if (this.isEOF()) {
  1382. console.log("unexpected eof...");
  1383. break
  1384. }
  1385. e.push(this.entityUpcreate())
  1386. }
  1387. return this.assertEOF(), e
  1388. }
  1389. }, {
  1390. key: "entityUpcreate",
  1391. value: function() {
  1392. var t = this.entityId(),
  1393. e = this.updateKind(),
  1394. r = {
  1395. entityId: t,
  1396. updateKind: e
  1397. };
  1398. return e === n.updateKinds.CREATE ? Object.assign(r, this.entityCreate()) : e === n.updateKinds.UPDATE ? Object.assign(r, this.entityUpdate()) : this.raiseUnexpected("Internal error"), r
  1399. }
  1400. }, {
  1401. key: "parseField",
  1402. value: function(t) {
  1403. n.fieldIdToType.hasOwnProperty(t) || this.raiseUnexpected("Unknown property field_id: " + t + " @ " + this.curEntityId, t);
  1404. var e = n.fieldIdToType[t];
  1405. if (!(e in this)) return this.raiseUnexpected("Internal error: method to parse field_type " + field_name + " not implemented"), {};
  1406. var r = {};
  1407. return r[n.fieldIdToName.hasOwnProperty(t) ? n.fieldIdToName[t] : "unk_" + e + "_" + t] = this[e](), r
  1408. }
  1409. }, {
  1410. key: "entityUpdate",
  1411. value: function() {
  1412. for (var t = this.fieldIdSpec(), e = {};;) {
  1413. var r = this.parseField(t);
  1414. this.assertNoIntersectingKeys(e, r), Object.assign(e, r);
  1415. var n = this.fieldIdSpec();
  1416. if (0 === n) break;
  1417. t += n
  1418. }
  1419. return e
  1420. }
  1421. }, {
  1422. key: "entityCreate",
  1423. value: function() {
  1424. var t = this.entityCreateTypeId();
  1425. t === n.entityTypes.UNKNOWN && this.raiseUnexpected("Entity create: " + this.curEntityId + ", " + t + ".", "create");
  1426. var e = {
  1427. entityType: t
  1428. };
  1429. return this.moveToNextCreate(), e
  1430. }
  1431. }]), f);
  1432.  
  1433. function f(t) {
  1434. _classCallCheck(this, f), this.at = 0, this.buffer = new Uint8Array(t), this.curEntityId = ""
  1435. }
  1436.  
  1437. function h(t) {
  1438. var e = new ArrayBuffer(t.length),
  1439. r = new Uint8Array(e),
  1440. n = 0,
  1441. i = !0,
  1442. o = !1,
  1443. s = void 0;
  1444. try {
  1445. for (var u, a = t[Symbol.iterator](); !(i = (u = a.next()).done); i = !0) {
  1446. var f = u.value;
  1447. r[n++] = f
  1448. }
  1449. } catch (t) {
  1450. o = !0, s = t
  1451. } finally {
  1452. try {
  1453. !i && a.return && a.return()
  1454. } finally {
  1455. if (o) throw s
  1456. }
  1457. }
  1458. return e
  1459. }
  1460. e.exports = {
  1461. Parser: a,
  1462. byteStringToBuffer: function(t) {
  1463. var e = t.split(" "),
  1464. r = [],
  1465. n = !0,
  1466. i = !1,
  1467. o = void 0;
  1468. try {
  1469. for (var s, u = e[Symbol.iterator](); !(n = (s = u.next()).done); n = !0) {
  1470. var a = s.value;
  1471. r.push(parseInt(a, 16))
  1472. }
  1473. } catch (t) {
  1474. i = !0, o = t
  1475. } finally {
  1476. try {
  1477. !n && u.return && u.return()
  1478. } finally {
  1479. if (i) throw o
  1480. }
  1481. }
  1482. return h(r)
  1483. },
  1484. bytesToBuffer: h
  1485. }
  1486. }, {
  1487. "./data.js": 4
  1488. }],
  1489. 8: [function(t, e, r) {
  1490. var i = t("./data.js"),
  1491. o = t("./parser.js").Parser,
  1492. f = t("./encoder.js").Encoder,
  1493. n = t("./injection.js").inject;
  1494.  
  1495. function s(t, e) {
  1496. var r = !0,
  1497. n = !1,
  1498. i = void 0;
  1499. try {
  1500. for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done); r = !0) {
  1501. var u = o.value,
  1502. a = new f;
  1503. h.call(t, a.encodeOutbound(u))
  1504. }
  1505. } catch (t) {
  1506. n = !0, i = t
  1507. } finally {
  1508. try {
  1509. !r && s.return && s.return()
  1510. } finally {
  1511. if (n) throw i
  1512. }
  1513. }
  1514. return null
  1515. }
  1516. var u = 0;
  1517. window.switchPeriod = 0.5, window.isOn = !1, window.switches = [80, 98, 28, -1];
  1518. var a = 0;
  1519. document.addEventListener("keydown", function(t) {
  1520. "t" !== t.key && "T" !== t.key || (window.isOn = !window.isOn, a = 0, console.log("Switch script on: " + window.isOn))
  1521. });
  1522. var h = n(null, function(t) {
  1523. var e = this;
  1524. window.sendPackets = function(t) {
  1525. return s(e, t)
  1526. };
  1527. var r = new o(t).parseOutbound();
  1528. if (r.kind === i.outPacketKinds.SPAWN && (window.isOn = !1), r.kind === i.outPacketKinds.UPDATE_TANK, r.kind !== i.outPacketKinds.INPUT) return t;
  1529. if (u++, window.isOn && u % window.switchPeriod == 0) {
  1530. a %= switches.length;
  1531. var n = window.switches[a++];
  1532. if (!(0 <= n)) return r.key |= i.keyInput.SWITCH_CLASS, s(this, [r]);
  1533. s(this, [{
  1534. kind: 4,
  1535. tankId: n
  1536. }])
  1537. }
  1538. return t
  1539. })
  1540. }, {
  1541. "./data.js": 4,
  1542. "./encoder.js": 5,
  1543. "./injection.js": 6,
  1544. "./parser.js": 7
  1545. }]
  1546. }, {}, [8]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement