Mobile Forces updater written in Bash and Python with compiled binaries available using Nuitka.
First, download this archive file and extract it inside the main Mobile Forces game folder in which System, Texture, Maps and other such folders reside.
If GitHub is down or for other reasons, the URL inside updater.sh (3rd line) may be changed:
url='https://mf.nofisto.com/fast_download'Before updating, keep in mind to backup the game in case you will want to revert back since the script will overwrite any mismatching file. To start updating, launch one of the updater.sh or updater.py scripts:
| OS | Script | Note |
|---|---|---|
| Linux | updater.sh | Just have Bash v4+ installed |
| Mac | updater.sh | Run as SHA_CMD='shasum -a 512 "$1"' bash updater.sh or install sha512sum |
| Any | updater.py | Just have Python v3.9+ installed |
Binary versions of the updater.py script compiled for Windows, Linux and Mac are available in the releases. Assuming this repo is in the Mobile Folders folder, you can run it in Docker like this
docker build -t updater:latest .
docker run \
-v ../Maps:/Maps \
-v ../Music:/Music \
-v ../Physics:/Physics \
-v ../Sounds:/Sounds \
-v ../System:/System \
-v ../Textures:/Textures \
updater:latestA text file named sha512.txt with a list of sha512 hashes and paths has to be made. Example of sha512.txt file:
b72da50395d4d57e87324127118112e81f43d5e2e50b9cc09ec565b30397bf651e9aa34c077311bb6cc0b5d68668291cebe2844b4342da020334189a6381a02c ../Maps/mf-dockyard.umf
d1065deb87d3dc0adc54609cf88dbeb5cef5b4aead0bcce676711d46f16c5e8efad8155f7bb60917b09daa74aececd7bf561229f2ca86823f67866bab91676f8 ../Maps/mf-Rail_Quarry.umf
b77a93511e709383ae5855fa35d8318288abed156f49e7333f9d5cbf51b66b9633218578c9bf0330fb3c31edddd5185dcedd7c30bb732e4a42e187f4d7bf4c53 ../Textures/rage_urban.utx
d529debe43dffd9662bf4844cbbb519cc0041208bf313dd8907dee9a6f637bd6fbd3be1ca3c716f4de13f4e741bbc82090582429c0ed3d9f63c7648ff4133558 ../Textures/rage_warehouse.utx
26a0013a03884642a66290298c9ee850616e18a54b7d19714dd29b5f19f36ecb4e1d1c2b0778571e77540618f09ddc2c30caec0a45548942d532814327357c0c ../Textures/train.utx
0324e4bdb205a9fd8a04e492c864d0ef5f963ba6c0ed723cb20694260d88c17627d9854542e6d40dda4a40fd5f6df57756a7e19775c4b34f34504f85a4efe709 ../Maps/mf-waterfront.umf
5b4488096c83b0cab8e688dd4ea42649765735310040683d07e65d6d31645bafc68ce63b9f8c0e502713a6469479bf01c5b6eb849f63a9db560a4038726e3a96 ../Maps/mf-western.umf
The file has to include all the game files that you want your clients to update. The list can be freely sorted, although it is recommended to sort it by modified date so that whenever new files are put to the server, clients can download them at the beginning stage of the script.
To be compatible with UCC version of updater that will download modded Mobile Forces version files, the list should be sorted in an order described here. It won't break the compatibility with this updater.
This script sets up fast_download directory as well as generates the sha512.txt file. Check out the full repo for more info on setting up your own server.
This Script was first made by Gregaras and then improved by Filip.
Looking for info at forums like StackOverflow and similar helped me write the first version of the script (was longer, had 21 loops). Also, one documentation I think helped me: https://en.wikibooks.org/wiki/Windows_Batch_Scripting
I tried to make most of the code POSIX and follow best practices from https://mywiki.wooledge.org/BashFAQ and not include features of Bash 4+ to be compatible with Apple's Bash 3.2.57 version (but in the end I failed)
Previously this program made use of UCC (dropped after this commit) and Windows scripts (dropped after this commit), so these branches were made: ucc and windows.
Scripts are licensed under Apache 2.0 license. The reason for picking this license is because the GNU project recommends it for small programs.