Compare commits
2 Commits
29e6c4f507
...
43c46f3a3a
| Author | SHA1 | Date |
|---|---|---|
|
|
43c46f3a3a | |
|
|
debe92afb4 |
|
|
@ -16,8 +16,10 @@ export default (/** @type {ModUtils} */ { modifyCode, insertCode, replaceCode, r
|
|||
insertCode(`this.y___ = function() { s___.t(5, 5); };
|
||||
this.a3a = function() { s___.w___(); aY.init(); }; /* here */`,
|
||||
`__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)`,
|
||||
`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)`)
|
||||
modifyCode(`var l;
|
||||
${insert(`if (__fx.customLobby.isActive()) l = __fx.customLobby.getSocketURL();
|
||||
else`)} if (b.c) { l = "ws://localhost:" + (7130 + d) + "/"; }`)
|
||||
|
||||
// if the server is unreachable
|
||||
insertCode(`if (socketId === 0) { q.a08(3249); return; } /* here */`,
|
||||
`if (socketId === 1 && __fx.customLobby.isActive()) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
import { definePatch, insert } from "../modUtils.js"
|
||||
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
|
||||
insertCode(`/* here */
|
||||
a = b.c + 60 * 1000;
|
||||
|
|
@ -14,6 +20,9 @@ export default definePatch(({ insertCode, modifyCode }) => {
|
|||
return;
|
||||
} ${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
|
||||
try {
|
||||
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(/(\(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
|
||||
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."
|
||||
|
|
@ -171,10 +165,6 @@ function applyPatches(/** @type {ModUtils} */ { replace, replaceOne, replaceRawC
|
|||
`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);")
|
||||
|
||||
// Invalid hostname detection avoidance
|
||||
replaceRawCode(`,this.hostnameIsValid=0<=window.location.hostname.toLowerCase().indexOf("territorial.io"),`,
|
||||
`,this.hostnameIsValid=true,`)
|
||||
|
||||
console.log('Removing ads...');
|
||||
// Remove ads
|
||||
replace('//api.adinplay.com/libs/aiptag/pub/TRT/territorial.io/tag.min.js', '');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import versionData from '../version.json';
|
||||
const { version, lastUpdated } = versionData;
|
||||
const { version, lastUpdated, isSignificant } = versionData;
|
||||
|
||||
import settingsManager from './settings.js';
|
||||
import { clanFilter, leaderboardFilter } from "./clanFilters.js";
|
||||
|
|
@ -22,7 +22,7 @@ __fx.isCustomLobbyVersion = window.location.href.startsWith("https://fxclient.gi
|
|||
const savedVersion = localStorage.getItem("fx_version");
|
||||
if (savedVersion !== version && !__fx.isCustomLobbyVersion) {
|
||||
localStorage.setItem("fx_version", version);
|
||||
if (savedVersion !== null) displayChangelog();
|
||||
if (savedVersion !== null && isSignificant) displayChangelog();
|
||||
}
|
||||
|
||||
__fx.settingsManager = settingsManager;
|
||||
|
|
|
|||
14
version.json
14
version.json
|
|
@ -1,11 +1,9 @@
|
|||
{
|
||||
"version": "0.6.18",
|
||||
"lastUpdated": "Dec 30",
|
||||
"version": "0.6.18.1",
|
||||
"lastUpdated": "Jan 25",
|
||||
"changes": [
|
||||
"Updated custom lobbies to the latest version",
|
||||
"When creating a custom lobby, you can now select a region where it will be created",
|
||||
"The latency to the custom lobby server is displayed below the header in the custom lobby UI",
|
||||
"Improved the propaganda blocking feature",
|
||||
"Added automatic patches for the special custom lobby version (https://fxclient.github.io/custom-lobbies) which continues to serve its purpose of guaranteeing access to custom lobbies while allowing the regular version to quickly be updated to the latest Territorial.io version, neglecting the custom lobby patches if needed"
|
||||
]
|
||||
"Fixes for game update v2.15.3",
|
||||
"The \"What's new\" screen is no longer shown automatically after insignificant updates (such as this one)"
|
||||
],
|
||||
"isSignificant": false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue