[Gensouband] Terminal size problem on .live server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cryomaniac
    Swordsman
    • Jan 2022
    • 283

    #16
    Which makefile you are using to build for .live?

    Comment

    • backwardsEric
      Knight
      • Aug 2019
      • 527

      #17
      These changes to main.c seem to get Gwarl's desired behavior, but they do (when the -u option is used) bypass the input sanitization done in process_player_name() to construct the save file. They also likely need better testing then I can do.

      Code:
      --- a/src/main.c
      +++ b/src/main.c
      @@ -298,6 +298,8 @@ int main(int argc, char *argv[])
      
              bool new_game = FALSE;
      
      +       bool sf_from_name = TRUE;
      +
              int show_score = 0;
      
              cptr mstr = NULL;
      @@ -483,7 +485,13 @@ int main(int argc, char *argv[])
                              {
                                      if (!argv[i][2]) goto usage;
      #ifdef ANGBAND_2_8_1
      -                               strcpy(player_name, &argv[i][2]);
      +                               strncpy(player_name, &argv[i][2],
      +                                       sizeof(player_name));
      +                               strncpy(savefile_base, &argv[i][2],
      +                                       sizeof(savefile_base));
      +                               path_build(savefile, sizeof(savefile),
      +                                       ANGBAND_DIR_SAVE, savefile_base);
      +                               sf_from_name = FALSE;
      #else /* ANGBAND_2_8_1 */
      
                                      /* Get the savefile name */
      @@ -789,7 +797,7 @@ int main(int argc, char *argv[])
              if (!done) quit("Unable to prepare any 'display module'!");
      
              /* Process the player name */
      -       process_player_name(TRUE);
      +       process_player_name(sf_from_name);
      
              /* Hack -- If requested, display scores and quit */
              if (show_score > 0) display_scores(0, show_score);

      Comment

      • Cryomaniac
        Swordsman
        • Jan 2022
        • 283

        #18
        Does the server even need this variant's savefile name input function? It was added for user convenience, but as I understand, the .live server automatically associates every account with their own active savefile on each variant anyway, so it should use the old logic, automatically deriving it from player_name, which is taken from -u argument (player username on server) at that point.

        Comment

        • backwardsEric
          Knight
          • Aug 2019
          • 527

          #19
          Originally posted by Cryomaniac
          Does the server even need this variant's savefile name input function? It was added for user convenience, but as I understand, the .live server automatically associates every account with their own active savefile on each variant anyway, so it should use the old logic, automatically deriving it from player_name, which is taken from -u argument (player username on server) at that point.
          Likely it does not, but to keep the code the same for people running it themselves (where entering the save file name be useful) the change I proposed just bypasses the name input function by calling process_player_name() with the argument set to false.

          Comment

          • Cryomaniac
            Swordsman
            • Jan 2022
            • 283

            #20
            It still would be the same for people running their personal versions; I'm suggesting making it a precompiler option, so that you can build the .live server side version without the name input, while the Windows build I'm distributing has the standard current name input logic.

            Comment

            • Cryomaniac
              Swordsman
              • Jan 2022
              • 283

              #21
              I added a precompiler option - -DDONT_ASK_FOR_SAVEFILE_NAME - that restores old savefile name logic. I did a quick test for a Windows build with this flag set on - it skipped the savefile name prompt, automatically creating a savefile for my character's name. Hopefully this will make the build work for the -u argument

              Made a commit to my github, along with makefile changes

              Comment

              • Gwarl
                Administrator
                • Jan 2017
                • 1025

                #22
                That looks like it should work I'll give it a try

                Comment

                • Gwarl
                  Administrator
                  • Jan 2017
                  • 1025

                  #23
                  That seems to work.

                  The variant seems to have its own logic for assigning subwindows. To be able to use the angband.live subwindow settings it would need the poschengband style subwindow layout logic.

                  The changes to main-gcu.c in this commit: https://github.com/Owen-GHB/angband-...f76cc30dcb9bc5

                  implement it for angband 2.9.3 and is my own reference for adding it to other variants.

                  It's curious because I thought hengband adopted that change just prior to the colour handling change but long after gensouband forked and gensouband seems to have the same colour handling as modern hengband and V

                  Comment

                  • Cryomaniac
                    Swordsman
                    • Jan 2022
                    • 283

                    #24
                    Added those changes in your commit to main-gcu.c in the project. init_gcu function in hengband is somewhat diverged from 2.9.3, so I just took the entire init_gcu function from your commit and replaced the existing one.

                    Made commit to my github project.

                    Comment

                    • Gwarl
                      Administrator
                      • Jan 2017
                      • 1025

                      #25
                      That doesn't seem have taken and I'm not sure why just yet, but the game seems quite playable overall.

                      Terminal size is calculated according to font size and screen resolution. I don't yet have a way to enforce valid terminal dimensions or provide useful feedback on the server side. But if your terminal is too small, reducing the font size might help

                      Comment

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