Gats.io - Anti Packet Injection

Hotfix for a bug that allows players to kick you out of the game (no longer needed)

  1. // ==UserScript==
  2. // @name Gats.io - Anti Packet Injection
  3. // @namespace http://tampermonkey.net
  4. // @version 0.7
  5. // @description Hotfix for a bug that allows players to kick you out of the game (no longer needed)
  6. // @author You
  7. // @match https://gats.io
  8. // @icon https://www.google.com/s2/favicons?domain=gats.io
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. //the bug has been fixed for a while now but damn that was a fun 2 days
  15. var list = ['a', 'b', 'c', 'd', 'e', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'p']
  16. var setOnMsg = setInterval(() => {
  17. if(RF.list[0].socket.readyState == 1) {
  18. RF.list[0].socket.onmessage = function(event) {
  19. var data = new TextDecoder().decode(event.data)
  20. var packets = data.split("|")
  21. for(var i in packets) {
  22. if(packets[i].trim() == "t" && parseInt(i) + 1 != packets.length) {
  23. return
  24. }
  25. else if(list.includes(packets[i].trim()) && packets[i].trim().length == 1) {
  26. return
  27. }
  28. }
  29. b18(event)
  30. }
  31. }
  32. }, 500)
  33.  
  34. })();