triplea icon indicating copy to clipboard operation
triplea copied to clipboard

GameSelectorModel - Validation errors parsing game-XML file: /home/peregrinenelson/triplea/downloadedMaps/2013_conflict/ga...

Open tripleabuilderbot opened this issue 4 months ago • 8 comments

User Description

this happened when i tried to open 2013 conflict FFA = Validation errors parsing game-XML file: /home/user/triplea/downloadedMaps/2013_conflict/games/2013 Conflict FFA.xml, errors: Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[] Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[] Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[] Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[]

Log Message

Validation errors parsing game-XML file: /home/peregrinenelson/triplea/downloadedMaps/2013_conflict/games/2013 Conflict FFA.xml, errors: Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[] Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[] Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[] Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):[]

TripleA Version

2.7.15136

Java Version

21.0.7

Operating System

Linux

Heap Size

688M

tripleabuilderbot avatar Aug 19 '25 17:08 tripleabuilderbot

@Author Whete did you get the map from? @beelee1 Can you answer my question? I'd like to see the file that is validated and fails.

frigoref avatar Aug 19 '25 21:08 frigoref

@frigoref yea I've never played this map. I'd have to dl and test it. Seems it's a xml error obviously. Unfortunately, I can't test on 2.5 unless I switch to windows, which takes a while for me to do.

So Idk if it worked in 2.5 or not.

The OP is on linux. I can verify if I get the same result. I'll try and test it after bit.

Edit So it's available in "Download Maps"

Image

Edit 2 Says "deeply modified" so xml, which you already know :) Wheter it worked in 2.5 and not now would be the question I guess.

Image

Edit 3 So yea, I get the same error on linux triplea 2.7+14962

Image

@TheDog-GH would you check this with windows. 2.5 and 2.7 both ? My guess is it's xml but whether or not it worked with 2.5 is the question. The error throws immediately before Game Start

beelee1 avatar Aug 20 '25 02:08 beelee1

This is a xml map error in Conflict 2013 FFA it crashes in both 2.5 & 2.7

2.5 error is the same as above after I had fixed the folder name.

@RogerCooper this is one of your uploads

TheDog-GH avatar Aug 20 '25 06:08 TheDog-GH

@beelee1, @TheDog-GH Did you redownload the map? I just downloaded it the first time and was able to run it and start a game. The file (2013 Conflict FFA.xml)[https://github.com/triplea-maps/2013Conflict/blob/cf1f07e62d10b786405258fae82fd1e8bb1bf483/games/2013%20Conflict%20FFA.xml#L1391] also looks okay for the canals

			 <attachment name="canalattachment1" attachTo="19 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory">
			     <option name="canalName" value="PanamaCanal"/>
			     <option name="landTerritories" value="Central America:Colombia"/>
			 </attachment>
			 <attachment name="canalattachment1" attachTo="20 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory">
			     <option name="canalName" value="PanamaCanal"/>
			     <option name="landTerritories" value="Central America:Colombia"/>
			 </attachment>
			 <attachment name="canalattachment2" attachTo="15 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory">
			     <option name="canalName" value="SuezCanal"/>
			     <option name="landTerritories" value="Egypt-Sudan:Syria-Israel"/>
			 </attachment>
			 <attachment name="canalattachment2" attachTo="34 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory">
			     <option name="canalName" value="SuezCanal"/>
			     <option name="landTerritories" value="Egypt-Sudan:Syria-Israel"/>
			 </attachment>

and I do not see why it should run into the exception of CanalAttachment.java.

  public void validate(final GameState data) throws GameParseException {
    if (canalName.isEmpty()) {
      throw new GameParseException("Canals must have a canalName set!" + thisErrorMsg());
    }
    if (getLandTerritories().isEmpty()) {
      throw new GameParseException(
          "Canal named " + canalName + " must have landTerritories set!" + thisErrorMsg());
    }
    final Set<Territory> territories = new HashSet<>();
    for (final Territory t : data.getMap()) {
      if (hasCanal(t, canalName)) {
        territories.add(t);
      }
    }
    if (territories.size() != 2) {
      throw new GameParseException(
          "Wrong number of sea zones for canal (exactly 2 sea zones may have the same canalName):"
              + territories);
    }
  }

Could you maybe share your game XML file for analysis?

frigoref avatar Aug 20 '25 10:08 frigoref

@frigoref Yes I did download it today using 2.7 which unzip it.

It looks like you are running as a zip in 2.5 and the error reporting as a zip is not as good as unzip.

If you unzip and run it again, I will predict it errors.

I view this issue as a Roger problem.

TheDog-GH avatar Aug 20 '25 11:08 TheDog-GH

I will provide a fix so a more precise error message is shown. Preview: Image @RogerCooper As I understood it, the map is in your hands, so I would ask you to provide a fix to rename the canal attachment name to use prefix 'canalAttachment'

frigoref avatar Aug 20 '25 14:08 frigoref

I will take a look at this over the weekend.

RogerCooper avatar Aug 20 '25 16:08 RogerCooper

New PR #13634 should now show the above error popup while PR #13633 should make it use TripleA look and feel.

frigoref avatar Aug 20 '25 18:08 frigoref