Fixes for game update v2.15.3
parent
29e6c4f507
commit
debe92afb4
|
|
@ -16,8 +16,10 @@ export default (/** @type {ModUtils} */ { modifyCode, insertCode, replaceCode, r
|
||||||
insertCode(`this.y___ = function() { s___.t(5, 5); };
|
insertCode(`this.y___ = function() { s___.t(5, 5); };
|
||||||
this.a3a = function() { s___.w___(); aY.init(); }; /* here */`,
|
this.a3a = function() { s___.w___(); aY.init(); }; /* here */`,
|
||||||
`__fx.customLobby.setJoinFunction(() => { s___.w___(); aY.init(); });`)
|
`__fx.customLobby.setJoinFunction(() => { s___.w___(); aY.init(); });`)
|
||||||
replaceCode(`var aRc;if(l.dk){aRc="ws://localhost:"+(7130+a09)+"/";}else{aRc=aRX[0]+az.y.aQ9[a09]+aRX[1+l.dl];}aRW=new WebSocket(aRc)`,
|
modifyCode(`var l;
|
||||||
`var aRc;if(l.dk){aRc="ws://localhost:"+(7130+a09)+"/";}else{aRc=aRX[0]+az.y.aQ9[a09]+aRX[1+l.dl];}aRW=new WebSocket(__fx.customLobby.isActive() && a09 === 1 ? __fx.customLobby.getSocketURL() : aRc)`)
|
${insert(`if (__fx.customLobby.isActive()) l = __fx.customLobby.getSocketURL();
|
||||||
|
else`)} if (b.c) { l = "ws://localhost:" + (7130 + d) + "/"; }`)
|
||||||
|
|
||||||
// if the server is unreachable
|
// if the server is unreachable
|
||||||
insertCode(`if (socketId === 0) { q.a08(3249); return; } /* here */`,
|
insertCode(`if (socketId === 0) { q.a08(3249); return; } /* here */`,
|
||||||
`if (socketId === 1 && __fx.customLobby.isActive()) {
|
`if (socketId === 1 && __fx.customLobby.isActive()) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
import { definePatch, insert } from "../modUtils.js"
|
import { definePatch, insert } from "../modUtils.js"
|
||||||
import { styleText } from "node:util";
|
import { styleText } from "node:util";
|
||||||
|
|
||||||
export default definePatch(({ insertCode, modifyCode }) => {
|
export default definePatch(({ insertCode, modifyCode, replaceCode }) => {
|
||||||
|
|
||||||
|
// Add FX Client version info to the game version window
|
||||||
|
modifyCode(`4, 1, new g(__L(), b.c + "<br>" + d.e.f("/changelog")
|
||||||
|
${insert(` + "<br><br><b>" + "FX Client v" + __fx.version
|
||||||
|
+ "<br><a href='https://discord.gg/dyxcwdNKwK' target='_blank'>FX Client Discord server</a>"
|
||||||
|
+ "<br><a href='https://github.com/fxclient/FXclient' target='_blank'>Github repository</a></b>"`)} /*...*/)`)
|
||||||
|
|
||||||
// Hide propaganda popup
|
// Hide propaganda popup
|
||||||
insertCode(`/* here */
|
insertCode(`/* here */
|
||||||
|
|
@ -14,6 +20,9 @@ export default definePatch(({ insertCode, modifyCode }) => {
|
||||||
return;
|
return;
|
||||||
} ${insert(`if (!__fx.settings.hidePropagandaPopup && !__fx.customLobby.isActive())`)} a.g.h(5);`)
|
} ${insert(`if (!__fx.settings.hidePropagandaPopup && !__fx.customLobby.isActive())`)} a.g.h(5);`)
|
||||||
|
|
||||||
|
// Invalid hostname detection avoidance
|
||||||
|
replaceCode(`this.hostnameIsValid = a.indexOf("territorial.io") >= 0;`, `this.hostnameIsValid = true;`)
|
||||||
|
|
||||||
// for the custom lobby version
|
// for the custom lobby version
|
||||||
try {
|
try {
|
||||||
modifyCode(`new a("⚔️<br>" + __L(), function() {
|
modifyCode(`new a("⚔️<br>" + __L(), function() {
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,6 @@ function applyPatches(/** @type {ModUtils} */ { replace, replaceOne, replaceRawC
|
||||||
replaceOne(/(\(6,"territorial\.io",6,")[^"]+"\),/g, "$1" + assets.fxClientLogo + "\"),");
|
replaceOne(/(\(6,"territorial\.io",6,")[^"]+"\),/g, "$1" + assets.fxClientLogo + "\"),");
|
||||||
replaceOne(/(\(22,"logo",8,")[^"]+"\)/g, "$1" + assets.smallLogo + "\")");
|
replaceOne(/(\(22,"logo",8,")[^"]+"\)/g, "$1" + assets.smallLogo + "\")");
|
||||||
|
|
||||||
// Add FX Client version info to the game version window
|
|
||||||
replaceRawCode(`ar.oa(4,1,new s8(__L(),c.gameVersion+"<br><a href='"+ah.aC5+"' target='_blank'>"+ah.aC5+"</a>",`,
|
|
||||||
`ar.oa(4,1,new s8(__L(),c.gameVersion+"<br><a href='"+ah.aC5+"' target='_blank'>"+ah.aC5+"</a>"
|
|
||||||
+ "<br><br><b>" + "FX Client v" + __fx.version + "<br><a href='https://discord.gg/dyxcwdNKwK' target='_blank'>FX Client Discord server</a>"
|
|
||||||
+ "<br><a href='https://github.com/fxclient/FXclient' target='_blank'>Github repository</a></b>",`);
|
|
||||||
|
|
||||||
// Add update information
|
// Add update information
|
||||||
replaceRawCode(`new k("🚀 New Game Update","The game was updated! Please reload the game.",!0,[`,
|
replaceRawCode(`new k("🚀 New Game Update","The game was updated! Please reload the game.",!0,[`,
|
||||||
`new k("🚀 New Game Update","The game was updated! Please reload the game."
|
`new k("🚀 New Game Update","The game was updated! Please reload the game."
|
||||||
|
|
@ -171,10 +165,6 @@ function applyPatches(/** @type {ModUtils} */ { replace, replaceOne, replaceRawC
|
||||||
`qr = (__fx.settings.detailedTeamPercentage ? (100*f0).toFixed(2) : Math.floor(100*f0+.5)) + "%"`)
|
`qr = (__fx.settings.detailedTeamPercentage ? (100*f0).toFixed(2) : Math.floor(100*f0+.5)) + "%"`)
|
||||||
replaceRawCode(",fontSize=+dz*Math.min(f0,.37);", ",fontSize=(__fx.settings.detailedTeamPercentage ? 0.75 : 1)*dz*Math.min(f0,.37);")
|
replaceRawCode(",fontSize=+dz*Math.min(f0,.37);", ",fontSize=(__fx.settings.detailedTeamPercentage ? 0.75 : 1)*dz*Math.min(f0,.37);")
|
||||||
|
|
||||||
// Invalid hostname detection avoidance
|
|
||||||
replaceRawCode(`,this.hostnameIsValid=0<=window.location.hostname.toLowerCase().indexOf("territorial.io"),`,
|
|
||||||
`,this.hostnameIsValid=true,`)
|
|
||||||
|
|
||||||
console.log('Removing ads...');
|
console.log('Removing ads...');
|
||||||
// Remove ads
|
// Remove ads
|
||||||
replace('//api.adinplay.com/libs/aiptag/pub/TRT/territorial.io/tag.min.js', '');
|
replace('//api.adinplay.com/libs/aiptag/pub/TRT/territorial.io/tag.min.js', '');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue