Pandora Directory Structure Question


Well, I was hoping that the system had been designed to deal with both of those scenarios. Could someone please explain what happens with the appdata folders when an app is updated and what happens with duplicates?
 
WizardStan said:
fearofshorts said:
Oh yeah, quick question: will there be a unique identifier for each PND sold/downloaded at the appstore?
I'd hate to end up with duplicate appdata folders.
You mean if someone creates "AwesomeGame" and then someone ELSE creates "AwesomeGame", can it handle them both?
Or someone creates "AwesomeGame" as "AwesomeGame.pnd" and then updates it with "AwesomeGameV2.pnd" will they both use the same appdata directory?
The developer who creates the PND decides on an unique ID. So if he chooses "test" or "foo" or "abc123" then there could be collisions; there are no checks for collisions (because how could there be? How does libpnd decide wich PND is the "righteous" owner of the appdata folder?)

So you should choose a good ID if you want to avoid collisions. Maybe not "!K§$%JMRGTWEKRP&JK" but for common names append your username ("quakemod-dflemstr") and for uncommon names just leave it ("vladivostok")
 
Last edited by a moderator:
dflemstr said:
So you should choose a good ID if you want to avoid collisions. Maybe not "!K§$%JMRGTWEKRP&JK" but for common names append your username ("quakemod-dflemstr") and for uncommon names just leave it ("vladivostok")

I thought the java solution to namespaces was a reasonably elegant solution to this problem: e.g., com.domainname.packagename
 
Last edited by a moderator:
todd said:
dflemstr said:
So you should choose a good ID if you want to avoid collisions. Maybe not "!K§$%JMRGTWEKRP&JK" but for common names append your username ("quakemod-dflemstr") and for uncommon names just leave it ("vladivostok")

I thought the java solution to namespaces was a reasonably elegant solution to this problem: e.g., com.domainname.packagename

I think this is a good idea as well. It works well for Java (and the Cocoa Framework on OS X). I also think it would be important to set something like this up as the standard in the documentation before too many people start creating stuff for Pandora so it's learned (and hopefully followed) from the start.
 
Last edited by a moderator:
BWoodson said:
todd said:
dflemstr said:
So you should choose a good ID if you want to avoid collisions. Maybe not "!K§$%JMRGTWEKRP&JK" but for common names append your username ("quakemod-dflemstr") and for uncommon names just leave it ("vladivostok")

I thought the java solution to namespaces was a reasonably elegant solution to this problem: e.g., com.domainname.packagename

I think this is a good idea as well. It works well for Java (and the Cocoa Framework on OS X). I also think it would be important to set something like this up as the standard in the documentation before too many people start creating stuff for Pandora so it's learned (and hopefully followed) from the start.
I +1 this too. But you have to remember that most users don't have a company backing them or a home page, so I'd suggest that users have the option to use "se.dflemstr.mygame" or "org.dflemstr.mygame" etc even if they don't own that domain... (That's how I prefix my Java/Scala packages btw)

And the names will be unintuitive for the average Joes who want to find an apps "appdata" folder...
And what about collaborative projects? Don't want to have the username included in that case...

Anyways, make a poll about it! (in the dev corner)
 
Last edited by a moderator:
dflemstr said:
I +1 this too. But you have to remember that most users don't have a company backing them or a home page, so I'd suggest that users have the option to use "se.dflemstr.mygame" or "org.dflemstr.mygame" etc even if they don't own that domain... (That's how I prefix my Java/Scala packages btw)

And the names will be unintuitive for the average Joes who want to find an apps "appdata" folder...
And what about collaborative projects? Don't want to have the username included in that case...

Anyways, make a poll about it! (in the dev corner)
A package is just a unique identifier with rules, in so far as they're strings. The Identifier code can exist exactly the same as it does now, and a "best practices" for how to create said identifiers can come up at any time without breaking anything.
 
Last edited by a moderator:
Againm all stuff we've been through many times :)

I'm a man of 'reasonably unique', without overkilling it. We don't want pure random numbers or to make peopel use a CGI to generate a ID from a central repository.. too much baggae for dev, and too much annoyance for users. I've been a fan of 'appname.devname.something' for awhile, but it might be too ugly. still.. battlejewels.skeezix.0001 is a pretty unique name, imho, but if someone collides, they have to be pretty going out of their way to do it :)

(and in my case "0001" means "state format" not "version of game" sinceI don't much believe in breaking state between versions.)

Anyway, currently the unique-id is used for unique-id and for appdata name, but I will be splitting it when I get a moment, so the dev can set the unique-id and also set the appdata-name (if other devs agree), so that the dev coudl be as free to use a crypitc name, or a common name, as he wants, rather than being forced into it. (I liek forcing devs into a pattern if its a good one, but clearly therte is some disagreement, so .. maybe I'll play it nice ;)

AS to:
"You mean if someone creates "AwesomeGame" and then someone ELSE creates "AwesomeGame", can it handle them both?
Or someone creates "AwesomeGame" as "AwesomeGame.pnd" and then updates it with "AwesomeGameV2.pnd" will they both use the same appdata directory?
"

Yes, of course we thought about it; we're professionals here. Spare time sure, but we're not idiots :)

Unique-ID collisions will vbe annoying, but shoudl not be common (the common scenario woudl be one dev copies is OldAwesomeGame to make NEwAwesomeGame and fortgets to update the unique-id; so worst case is one dev breaks his own shit, really, until he fixes it. No big deal, right? Same risk has always existed for every app for every OS ever, as well.) For Awesome1 and Awesome2, the unique-id and appdata-name can be updated at developer leisure -- if he wants to use a new appdata, or not, is purely up to him (as it always has been for every app and OS.) -- if if the state data is needing to be new, he can bump the id and get a new dir. Consider how many times for some apps you had to wipe out the old data before copying in the binary, whereas others you don't have to. That shoudl all be magicly taken care of now.

So yes, we've thought of most scenarios,m and tried to make it 'fail gracefully' :)

jeff
 
dflemstr said:
I +1 this too. But you have to remember that most users don't have a company backing them or a home page, so I'd suggest that users have the option to use "se.dflemstr.mygame" or "org.dflemstr.mygame" etc even if they don't own that domain... (That's how I prefix my Java/Scala packages btw)

And the names will be unintuitive for the average Joes who want to find an apps "appdata" folder...
And what about collaborative projects? Don't want to have the username included in that case...

Anyways, make a poll about it! (in the dev corner)

That's pretty much the same thing I did when I was doing programming in Cocoa. I don't see it being too big of an issue to have people make something up if they don't have their own domain.

The way I see it there will be some sort of package manager crop up for end users to use. If that's the case then this sort of naming scheme won't matter to the end user due to the "It Just Works (tm)" package manager parsing out the correct app name for the user. As far as I'm concerned anyone who wants to go poking around in appdata should understand the naming scheme being used.
 
Last edited by a moderator:
skeezix said:
AS to:
"You mean if someone creates "AwesomeGame" and then someone ELSE creates "AwesomeGame", can it handle them both?
Or someone creates "AwesomeGame" as "AwesomeGame.pnd" and then updates it with "AwesomeGameV2.pnd" will they both use the same appdata directory?
"

Yes, of course we thought about it; we're professionals here. Spare time sure, but we're not idiots :)
The reason I asked the fearofshorts to clarify is because the two questions are mutually exclusive problems that need to be solved differently. You can't solve both of them; either two PND files have the same identifier so you assume they are the same game and use the same appdata directory, or assume they are different games that have unfortunately used the same identifier and therefore get different appdata. I was pretty sure I knew which way you solved them, but I didn't want to pipe in with an answer unless I knew what he was actually asking for.
 
Last edited by a moderator:
Back
Top