fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Simple Universal Game Updater
|
||||
# Universal Game Updater
|
||||
|
||||
A simple, self-hosted updater for distributing game client files. Consists of three parts:
|
||||
|
||||
@@ -68,9 +68,15 @@ Edit the configuration block at the top of `updater.py`:
|
||||
|
||||
```python
|
||||
GAME_NAME = "My Game"
|
||||
UPDATER_NAME = "Launcher"
|
||||
WINDOW_WIDTH = 450
|
||||
WINDOW_HEIGHT = 300
|
||||
BANNER_WIDTH = 430
|
||||
BANNER_HEIGHT = 140
|
||||
|
||||
SERVER_ADDRESS = "update.mygame.com" # domain or IP
|
||||
SERVER_PORT = "3232"
|
||||
USE_HTTPS = False
|
||||
SERVER_PORT = "443" # 80/443 for HTTP/HTTPS, or a custom port for direct IP
|
||||
USE_HTTPS = True
|
||||
|
||||
CLIENT_KEYS = {
|
||||
"Main": "<same-hex-key-as-in-server-config.json>",
|
||||
@@ -84,8 +90,12 @@ ICON_RELATIVE_PATH = "icon.ico"
|
||||
```
|
||||
|
||||
- `SERVER_ADDRESS` accepts either a domain name or a raw IP — nothing else needs to change.
|
||||
- `SERVER_PORT` / `USE_HTTPS` should match how your server is actually reachable. If nginx force-redirects port 80 to 443, set `SERVER_PORT = "443"` and `USE_HTTPS = True` directly rather than relying on the redirect — the updater downloads files one request at a time, so an extra 80→443 redirect on every file adds real overhead on large clients.
|
||||
- `CLIENT_KEYS` maps a friendly name shown in the UI to the actual access key sent in the request URL. Keys must match `config.json` on the server exactly.
|
||||
- `GAME_EXE_RELATIVE_PATH` is where the updater looks for the game's executable, relative to the folder the updater itself is placed in.
|
||||
- `BANNER_WIDTH` / `BANNER_HEIGHT` — the banner image is always scaled to exactly this size, so it doesn't matter what dimensions the source `banner.png` actually has; the layout won't shift.
|
||||
|
||||
Banner scaling uses [Pillow](https://pypi.org/project/Pillow/) if it's installed (`pip install Pillow`), for proper resizing. If Pillow isn't available, the updater falls back to Tkinter's built-in (cruder, integer-only) zoom/subsample — it'll still work, just less precisely scaled. Install Pillow for best results, and make sure it's bundled when compiling (see below).
|
||||
|
||||
Then compile with your favorite tool, e.g. [PyInstaller](https://pyinstaller.org/):
|
||||
|
||||
@@ -139,4 +149,5 @@ Add any player-specific files (settings, saves, screenshots, logs) here so the u
|
||||
|
||||
- File integrity is checked with MD5 — fine for detecting changed files, not intended as a cryptographic guarantee.
|
||||
- The server has no built-in rate limiting or HTTPS; put it behind a reverse proxy (nginx, Caddy) if you need either.
|
||||
- The server never serves directory listings — a bare `/`, an unknown key, or a path that tries to escape the client folder (`..`) all get a 404, including the server's own script/config files.
|
||||
- `updater.py` uses Tkinter for the UI, which ships with most standard Python installs on Windows.
|
||||
|
||||
Reference in New Issue
Block a user