Analysis of the /lib directory and suggested changes.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CJNyfalt
    Swordsman
    • May 2007
    • 289

    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.
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by CJNyfalt
    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 whispers something about options. -more-

    Comment

    • CJNyfalt
      Swordsman
      • May 2007
      • 289

      #3
      Originally posted by takkaria
      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?

      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.


      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.

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        Originally posted by CJNyfalt
        Why there and not to /lib/file as in most variants?
        I think that you misunderstood.
        Almost certainly.

        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 whispers something about options. -more-

        Comment

        • CJNyfalt
          Swordsman
          • May 2007
          • 289

          #5
          Originally posted by takkaria
          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.

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            Originally posted by CJNyfalt
            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, 13:22.
            takkaria whispers something about options. -more-

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎