Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old June 21, 2007, 16:49   #1
CJNyfalt
Swordsman
 
Join Date: May 2007
Posts: 289
CJNyfalt is on a distinguished road
Analysis of the /lib directory and suggested changes.

Here's an analysis of the /lib directory structure with proposed changes.
I'm posting this for suggestions, comments and corrections.
I will later post a ticket for Vanilla and make changes for Sangband.

First we take a look at the directory structure:

/lib/apex:
Contains the high-score list.
Needs to be game-writeable, and should preferably be global.

/lib/bone:
Contains player ghost information on variants with them.
Needs to be game-writeable, and should preferably be global.

/lib/data:
Contains the 'compiled' versions of the files in /lib/edit.
Should preferably be game-writeable and global.

/lib/edit:
Contains the text-version of the files in /lib/data.
Should be global.

/lib/file:
Contains text files used by the game that neither fits in to
/lib/edit or /lib/help category.
Should be global.

/lib/help:
Contains text files used by the in-game help.
Should be global.

/lib/info:
Serves no useful in-game purpose. Used in some variants to
store text-files that aren't used in-game.
Should be removed. Eventual content should be moved to /doc.

/lib/pref:
Contains global preset preference files. Overrided by files in
/lib/user.
Should be global.

/lib/save:
Contains savegames.
Needs to be game-writable. Should preferably be user-specific.

/lib/user:
Contains user editable preference files.
Should preferably be game-writable and user-specific.

/lib/xtra:
Contains multimedia files.
Should be global.



Then we take a look at what certain defines do.

PRIVATE_USER_PATH:
This replaces /lib/user with the path specified in the define.

USE_PRIVATE_PATHS:
This replaces apex, bone, save and data with subdirs of PRIVATE_USER_PATH.
This makes all game-writable dirs user-specific.

So far, so good, but what about save? I listed it above as preferably
user-specific. IMO, it should be user-specific always, if PRIVATE_USER_PATH
is defined. This would also allows us to remove the SAVEFILE_USE_UID code.


So to summarize my suggestions:
- Remove /lib/info, move eventual content to /doc.
- Use PRIVATE_USER_PATH/save for savefiles always if PRIVATE_USER_PATH is
defined.
- Remove the SAVEFILE_USE_UID code.
CJNyfalt is offline   Reply With Quote
Old June 21, 2007, 17:44   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by CJNyfalt View Post
So to summarize my suggestions:
- Remove /lib/info, move eventual content to /doc.
- Use PRIVATE_USER_PATH/save for savefiles always if PRIVATE_USER_PATH is defined.
- Remove the SAVEFILE_USE_UID code.
I'm not removing lib/info, since random name files will go in there at some point, and it's blatantly not documentation.

I disagree with removing SAVEFILE_USE_UID, on the basis that if savefiles are shared, you need the uid to distinguish them.

If you're going to use a private path for everything else, you might as well do the same for savefiles, it's true.

PS. You may want to post stuff like this to the angband-dev list.
takkaria is offline   Reply With Quote
Old June 21, 2007, 22:05   #3
CJNyfalt
Swordsman
 
Join Date: May 2007
Posts: 289
CJNyfalt is on a distinguished road
Quote:
Originally Posted by takkaria View Post
I'm not removing lib/info, since random name files will go in there at some point, and it's blatantly not documentation.
Why there and not to /lib/file as in most variants?

Quote:
I disagree with removing SAVEFILE_USE_UID, on the basis that if savefiles are shared, you need the uid to distinguish them.

If you're going to use a private path for everything else, you might as well do the same for savefiles, it's true.
I think that you misunderstood.
As it's now, either only /lib/user or everything that can be saved uses private path.
I would like to change that to (/lib/user and savefiles) or everything.
And IMO savefiles shouldn't be shared on a multi-user system, because if an user is deleted, then the sys-admin has to hunt down and delete those savefiles separately.


Quote:
PS. You may want to post stuff like this to the angband-dev list.
Thanks, but no thanks. I don't plan to get involved with vanilla all that much.
And I already joined one dead angband-dev last year.
http://vlists.pepperfish.net/cgi-bin...ev-kaboodle.be
CJNyfalt is offline   Reply With Quote
Old June 21, 2007, 23:37   #4
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by CJNyfalt View Post
Why there and not to /lib/file as in most variants?
Quote:
I think that you misunderstood.
Almost certainly.

Quote:
As it's now, either only /lib/user or everything that can be saved uses private path.
I would like to change that to (/lib/user and savefiles) or everything.
And IMO savefiles shouldn't be shared on a multi-user system, because if an user is deleted, then the sys-admin has to hunt down and delete those savefiles separately.
Keeping savefiles in the user's directory is insecure, because the player can hack the savefile. Basically, if the savefile is kept locally, then everything should be, and there should be no option about it.
takkaria is offline   Reply With Quote
Old June 22, 2007, 09:05   #5
CJNyfalt
Swordsman
 
Join Date: May 2007
Posts: 289
CJNyfalt is on a distinguished road
Quote:
Originally Posted by takkaria View Post
Keeping savefiles in the user's directory is insecure, because the player can hack the savefile.
Why do we care? It's just a game and it's way easier to hack the source of the game instead if we care about ladders and competitions.
CJNyfalt is offline   Reply With Quote
Old June 22, 2007, 13:26   #6
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by CJNyfalt View Post
Why do we care? It's just a game and it's way easier to hack the source of the game instead if we care about ladders and competitions.
My point is that if you're going to have local savefiles always, then you shouldn't ever have global highscores because you don't want hacked versions of the game adding to the highscore table.

EDIT: I'm starting to soften to the idea of storing everything that the game writes in ~/.angband now. I'll make a poll for it.

Last edited by takkaria; June 22, 2007 at 14:22.
takkaria is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.