Identify and patch MegaMek's single-game-per-JVM blocker master
IsolationCheck shows two games in one JVM are properly isolated at the data layer: distinct Entity, Game, Board and Player objects, and two Servers bind and coexist. Entity IDs overlap across games, which is harmless since each Game indexes its own. The transport layer is not isolated. Server's constructor ends with 'serverInstance = this', and AbstractGameManager routes every outbound packet through the static Server.getServerInstance(). Constructing a second Server therefore redirects the first game's packets to the second game's connections. Observed symptom: games run fine until game 2 starts, then every game wedges with 'invalid movement/deployment packet' and all threads go idle. Patch gives AbstractGameManager a reference to its owning Server, set from the Server constructor, falling back to the static when unset so existing single game paths are unchanged. Two files, ~20 lines. MegaMek.jar is sealed, so patched classes cannot shadow it via the classpath; build-patched-jar.sh recompiles and injects them into a copy of the jar. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>