Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified map-generator/assets/maps/thebox/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
"tourney4": "Tourney 8 Teams",
"passage": "Passage",
"sierpinski": "Sierpinski",
"thebox": "The Box",
"thebox": "The Box PLUS",
"twolakes": "Two Lakes",
"straitofhormuz": "Strait of Hormuz",
"surrounded": "Surrounded",
Expand Down
67 changes: 53 additions & 14 deletions resources/maps/thebox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,69 +17,108 @@
"name": "TheBox",
"nations": [
{
"coordinates": [10, 10],
"coordinates": [
10,
10
],
"flag": "",
"name": "King of the Corner"
},
{
"coordinates": [1024, 300],
"coordinates": [
1024,
300
],
"flag": "",
"name": "Suspicious Ally"
},
{
"coordinates": [1650, 400],
"coordinates": [
1650,
400
],
"flag": "",
"name": "Evan The Dev"
},
{
"coordinates": [1024, 1024],
"coordinates": [
1024,
1024
],
"flag": "",
"name": "Middle Defender"
},
{
"coordinates": [350, 1024],
"coordinates": [
350,
1024
],
"flag": "",
"name": "Punch Merchant"
},
{
"coordinates": [1700, 1024],
"coordinates": [
1700,
1024
],
"flag": "",
"name": "Nuke Thrower"
},
{
"coordinates": [400, 1650],
"coordinates": [
400,
1650
],
"flag": "",
"name": "Fullsender"
},
{
"coordinates": [1024, 1750],
"coordinates": [
1024,
1750
],
"flag": "",
"name": "Factory Builder"
},
{
"coordinates": [1650, 1650],
"coordinates": [
1650,
1650
],
"flag": "",
"name": "Front Manager"
},
{
"coordinates": [700, 700],
"coordinates": [
700,
700
],
"flag": "",
"name": "Box Fighter"
},
{
"coordinates": [1350, 700],
"coordinates": [
1350,
700
],
"flag": "",
"name": "Cage Liberator"
},
{
"coordinates": [700, 1350],
"coordinates": [
700,
1350
],
"flag": "",
"name": "Train Trader"
},
{
"coordinates": [1350, 1350],
"coordinates": [
1350,
1350
],
"flag": "",
"name": "Non-peaceful Bot"
}
]
}
}
2 changes: 1 addition & 1 deletion resources/maps/thebox/map.bin

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/maps/thebox/map16x.bin

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/maps/thebox/map4x.bin

Large diffs are not rendered by default.

Binary file modified resources/maps/thebox/thumbnail.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/core/game/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export enum GameMapType {
Tourney4 = "Tourney 8 Teams",
Passage = "Passage",
Sierpinski = "Sierpinski",
TheBox = "The Box",
TheBox = "The Box PLUS",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the enum value is used in serialization or stored configs
rg -n "The Box" --type=ts -C2

Repository: openfrontio/OpenFrontIO

Length of output: 340


🏁 Script executed:

#!/bin/bash
# Check for any references to this map in test files or configs
rg -n "TheBox|thebox" --type=json -g '!**/lang/**' -g '!**/manifest.json'

Repository: openfrontio/OpenFrontIO

Length of output: 131


🏁 Script executed:

#!/bin/bash
# Find the enum definition and how it's used
rg -n "enum.*GameMapType|TheBox" --type=ts -B2 -A10 | head -80

Repository: openfrontio/OpenFrontIO

Length of output: 4025


🏁 Script executed:

#!/bin/bash
# Search for deserialization logic that might use the enum value
rg -n "deserialize|fromJSON|parse" --type=ts -A5 | grep -A5 -B5 "GameMapType\|TheBox" | head -80

Repository: openfrontio/OpenFrontIO

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Check if the enum value is directly compared or used for lookups
rg -n "\"The Box\"|'The Box'" --type=ts

Repository: openfrontio/OpenFrontIO

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Find where GameMapType enum is used for serialization
rg -n "GameMapType" --type=ts -B2 -A2 | head -100

Repository: openfrontio/OpenFrontIO

Length of output: 5132


Breaking change: enum value affects deserialization.

Changing the enum value from "The Box" to "The Box PLUS" breaks backward compatibility. The Zod validation schemas in src/core/Schemas.ts (GameConfig, ServerPrestartMessageSchema) validate serialized values against enum values. Existing game configs and network messages with "The Box" will fail deserialization.

The filesystem path lookup still works (uses enum key TheBox"thebox"), but any saved games, replays, or cross-version communication will break.

If this is temporary, document the breaking change clearly. Otherwise, implement a migration strategy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/game/Game.ts` at line 125, The enum member TheBox was changed from
"The Box" to "The Box PLUS", which breaks deserialization; revert or add
compatibility: update the Game enum member TheBox in Game.ts back to the
original "The Box" (or else add a stable canonical value plus a legacy alias),
and modify the Zod schemas GameConfig and ServerPrestartMessageSchema in
src/core/Schemas.ts to accept both values (use a z.union or include the legacy
literal) so existing saved games/replays and network messages with "The Box"
continue to parse; alternatively, if intentional, add a clear migration path and
documentation so deserializers can map "The Box" → "The Box PLUS".

TwoLakes = "Two Lakes",
StraitOfHormuz = "Strait of Hormuz",
Surrounded = "Surrounded",
Expand Down
Loading