Apparently defective Config/shipdata.plist files

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Apparently defective Config/shipdata.plist files

Post by phkb »

Smivs wrote:
What did you find/do
The errors I found were things like: last shipdata entry not having a ";" at the end (it's implied for Windows and Linux, but OSX doesn't like it); looking for things like "{ hue=30 };" and adding the missing ";", to make it "{ hue=30; };" (again, Windows/Linux can imply the ";", OSX doesn't). That sort of thing.

Do you want me to run my eyes over any particular file for you?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Apparently defective Config/shipdata.plist files

Post by phkb »

@smivs:
What I found:
Clippers: look for the "boaclipper-player" entry, no ";" after the "like_ship" value.
Liners: there are a few "{ hue = x };" items (ie missing the ";" after the value.
YellooCabs: in the "yellOo-cab-player" entry, in the "script_info" entry, there is no ";" after the "oolite-barred-equipment" value
in the "yellOo-cab-taxi-NPC" entry, in the "materials" section, in the "specular_map", the "extract_channel" value is missing a trailing ";"

Hope that helps a bit!
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Apparently defective Config/shipdata.plist files

Post by Smivs »

That helps a lot! Thank you :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
hoqllnq
Commodore
Commodore
Posts: 154
Joined: Sun Jan 08, 2006 7:32 pm

Re: Apparently defective Config/shipdata.plist files

Post by hoqllnq »

I did a funny thing:
When a .plist fails to parse on Mac, I run the data through my own (very forgiving) parser and re-serialize it and then try again with the new data.
It works. I'm not sure whether it is a good idea to actually deploy this, but if anyone is interested to look at it, this is it:
https://github.com/jobi-wan/oolite/comm ... 3a6367cce2
Last edited by hoqllnq on Sun Oct 22, 2017 6:42 am, edited 1 time in total.
Fleurghber
Dangerous
Dangerous
Posts: 93
Joined: Sat Oct 07, 2017 1:24 pm

Re: Apparently defective Config/shipdata.plist files

Post by Fleurghber »

The new version of Extra Thargoids seems to be working.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Apparently defective Config/shipdata.plist files

Post by Diziet Sma »

hoqllnq wrote: Sat Oct 21, 2017 2:21 pm
I did a funny thing:
When a .plist fails to parse on Mac, I run the data through my own (very forgiving) parser and re-serialize it and then try again with the new data.
It works. I'm not sure whether it is a good idea to actually deploy this, but if anyone is interested to look at it, this is it:
https://github.com/jobi-wan/oolite/comm ... 3a6367cce2
Interesting solution. Like you, I'm not sure if deploying it would be a good idea.. how well does it cope if the problem is something more serious than a missing semi-colon?
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
hoqllnq
Commodore
Commodore
Posts: 154
Joined: Sun Jan 08, 2006 7:32 pm

Re: Apparently defective Config/shipdata.plist files

Post by hoqllnq »

Diziet Sma wrote: Sun Oct 22, 2017 10:05 am
how well does it cope if the problem is something more serious than a missing semi-colon?
In that case, the OXP developer would notice upon testing on a non-Mac system. (But that's not what you're asking...)

It allows the wrong kinds of brackets / parentheses, missing commas, using commas instead of semicolons and vice versa, colons instead of equals, I think it will happily treat JSON as openstep plist.
If it can't "fix" it, it will fail in the same way it does now, and report it as "Unfixable".

I guess what you're getting at is: Will it hang or crash when throwing absolute garbage at it?
Not easily but I can try and handcraft some data specifically to confuse it.
[EDIT]
That was easy! :oops: It would hang on unterminated /* comments..
Also easily fixed though: end-of-data is now also considered a valid end-of-comment.
[/EDIT]


But mainly, it doesn't fix the source of the problem. It just masks it.
What would probably be more useful is to turn it into a validator that spits out more useful messages than "unexpected { at line 1" and doesn't bail out on the first error. And then as a separate tool for OXP devs to test their work.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Apparently defective Config/shipdata.plist files

Post by Diziet Sma »

hoqllnq wrote: Sun Oct 22, 2017 1:54 pm
I guess what you're getting at is: Will it hang or crash when throwing absolute garbage at it?
Not easily but I can try and handcraft some data specifically to confuse it.
[EDIT]
That was easy! :oops: It would hang on unterminated /* comments..
Also easily fixed though: end-of-data is now also considered a valid end-of-comment.
[/EDIT]


But mainly, it doesn't fix the source of the problem. It just masks it.
What would probably be more useful is to turn it into a validator that spits out more useful messages than "unexpected { at line 1" and doesn't bail out on the first error. And then as a separate tool for OXP devs to test their work.

Yes, that was what I was getting at.. and I'm glad I inadvertently helped you improve it.

A good validator for for non-Mac OXP authors really would be a useful tool.. as you're probably well aware, this has been an ongoing problem for years.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Post Reply