SWF movie loading crashed with __debugbreak when the window height was
below 720px (e.g. after leaving exclusive fullscreen). The fallback
chain only tried 720.swf which doesn't exist. Now falls back through
720 -> 1080 so scenes always find a valid SWF.
PlayerConnection::handleChat called FormatChatMessage with
applyStyling=false before broadcasting, which stripped all color codes
from the message. The client then had nothing left to format. Send the
raw message and let the client handle formatting on receive.
Three issues fixed:
- Save file path used hardcoded saveData.ms but new 4JLibs names files
as <title>.ms. ReadLevelNameFromSaveFile now constructs the correct
path with fallback to saveData.ms for old saves.
- The level.dat code path for reading the hardcore flag (sidecar rename)
returned early without ever parsing level.dat. Now stores the sidecar
name and continues to read the hardcore flag from NBT.
- The thumbnail host options path could overwrite m_bHardcore to false.
Now only upgrades to true, never downgrades.
- Load menu constructor and tick handler both lock difficulty slider to
Hardcore and gamemode to Survival when hardcore is detected.
- Hide title logo on load menu to match create world menu.
The new 4JLibs CaptureThumbnail produces all-black 64x64 PNGs because
its internal m_backBufferTexture copy fails silently. Bypass it entirely
and capture from the swap chain backbuffer using the same proven approach
as our F2 screenshot, with center-crop and downsample to 64x64 PNG.
- Remove shadowcolor from font tags (Iggy doesn't support multiple)
- Enforce HTML text mode on chat labels and jukebox
- Move IDS translatable pattern matching into FormatChatMessage
- Add §r (reset) color code support
- Fix message truncation to count visible characters, skipping HTML tags
- Fix CJK truncation using raw index instead of visible char count
Includes fixes and some modernizations compared to the original 4J
library binaries. Also introduces functionality to support stuff like
F2 screenshots, etc. This is basically the beginning of modernizing the
codebase.
Notably also adds some metadata files for NixOS
* add support for linux clang cross compiles
* add linux clang instructions
* un-capitalize Mob.horse.*
* update the description in flake.nix
---------
Co-authored-by: Loki <lokirautio@gmail.com>
* f3 menu text scaling
* Reduce overscaling above 1080p
Restores original scaling for 1440p to try and keep the text size more
sane on high DPI monitors
---------
Co-authored-by: Loki Rautio <lokirautio@gmail.com>
* add chat support for html formatting
* html character serialization, normal color format support
* change for chat input handling on color
has a bug where the text after the cursor gets stripped of its color, need to make a function to backstep on a string and find the last used color codes, or get all color codes used before the string is split, and apply them to the start of the next string
* expose jukebox label as action bar like java
* prevent players from sending chat color
* restore non styled chat size check
* f3 menu text scaling
* Reduce overscaling above 1080p
Restores original scaling for 1440p to try and keep the text size more
sane on high DPI monitors
---------
Co-authored-by: Loki Rautio <lokirautio@gmail.com>
When a new player was whitelisted while they were sitting on the join screen, their next attempt would insta-kick before the world ever loaded, and the retry after that would let them in for roughly 20 seconds before booting them with "connection closed". Two separate bugs were colliding.
The first kick was a stale cancel flag on the client. When the server rejects a join, the "Connecting to host..." screen tears down, and its teardown path fires the cancel callback defensively. That flag would latch on without ever being consumed, so the very first tick of the next join attempt saw it and immediately closed the fresh connection. Clearing the flag when a new join starts prevents this.
The second kick was an orphan on the server. When the first failed join's TCP dropped, its slot got recycled for the next successful join, but the half-built login object from the broken attempt was still in the pending queue. 30 seconds later its "login took too long" timer fired, and the disconnect packet it tried to send was routed to whoever currently held that slot, which was now the new in-world player. It landed on their live socket and kicked them. Telling the game's Socket layer about the TCP drop lets the orphan clean itself up, and refusing to write on an already-closing socket stops any late packet from leaking into the recycled slot.
Before this change, turning VSync off did not actually uncap your frame rate. The game ran in borderless fullscreen, where Windows' desktop compositor owns the display pipeline and applies its own VSync regardless of what the game asks for. So on a 240Hz monitor with a GPU that could draw 800fps, you still only saw 240 frames per second and the other 560 were thrown away. Worse, the frames you did see were up to a refresh cycle stale by the time they hit your eyes, which is input latency you can feel when moving the camera or aiming.
Fullscreen now uses true DXGI exclusive mode, where the compositor is out of the way and the swap chain writes directly to the display. Every frame the GPU produces lands on screen as soon as it is ready, so "VSync off" actually does something. Expect FPS to climb well past your monitor's refresh rate and the mouse to feel noticeably more responsive.
Exclusive fullscreen also displays at your monitor's native resolution with no driver-side scaling or filtering. The backbuffer is grown to match the monitor exactly before the transition, and the display mode is pinned to the backbuffer size so nothing in the output pipeline resamples your pixels on the way to the screen. The result is a crisp 1:1 image with none of the softening or greyish filter that stretched output can introduce.
Yes, this is the mode where screen tearing can happen. Tearing gets a bad reputation but it is a visual tradeoff, not a bug, and many players prefer it over the latency VSync causes. If you want to avoid tearing, just turn VSync on in the settings and the game will cap cleanly to your refresh rate. You now have a real choice between the two instead of "off" quietly being broken.
Under the hood, F11 and the saved fullscreen preference both route through a new ApplyExclusiveFullscreen path that does Microsoft's recommended transition: grow the window to cover the monitor, ResizeTarget with no scaling so the display mode is pinned to the backbuffer size, SetFullscreenState(TRUE), SetColorSpace1(sRGB), then a second ResizeTarget so picky drivers actually apply the mode. Exit forces a real decorated windowed state so F11 cycles cleanly between windowed and exclusive fullscreen. ResizeD3D skips its swap-chain-recreate path while in exclusive mode so it does not fight DXGI for ownership.
The swap chain's RefreshRate changes from a hardcoded 60Hz to 0/0 so DXGI matches the current display mode. Fixes an "input signal out of range" error that could happen on high-refresh monitors after entering fullscreen, where the monitor was being asked to renegotiate timing off of 240Hz down to 60Hz on every launch.