Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random welcome.ans files not working as they should #1637

Open
the-godfather-007 opened this issue Nov 23, 2024 · 5 comments · May be fixed by #1645
Open

Random welcome.ans files not working as they should #1637

the-godfather-007 opened this issue Nov 23, 2024 · 5 comments · May be fixed by #1645
Assignees

Comments

@the-godfather-007
Copy link

At random, when a user logs into the WWIV BBS, and the BBS has random welcome.ans screens as welcome.0 welcome.1 welcome.2 ..etc... or welcome.1 welcome.2 doesn't matter .. one random choice appears to be display nothing. And or the issue is the Hit [ESC] fake mailer (Bot check) at initial connect. It happens after hitting escape twice and appears to happen more if the [ESC] has any length of pause between the first and second key press. I would think the only thing that would abort (or should) an ansi file from displaying would be the space bar, and only if that has not been disabled with an MCI code? This is also per instruction from a dev to place them in /wwiv/menus/wwiv/gfiles

@ericpareja
Copy link
Contributor

Do you still have a welcome.ans file?

This is the fallback if the randomfile display doesn't work.

This is in bbs/lilo.cpp GetAnsiStatusAndShowWelcomeScreen()

if (!bout.printfile_random(WELCOME_NOEXT)) {
  bout.printfile(WELCOME_NOEXT);
}

@the-godfather-007
Copy link
Author

If I use a welcome.ans at all (within directory /wwiv/gfiles or /wwiv/menus/wwiv/gfiles) it ONLY displays welcome.ans. The random only appears to work IF the .ans extension is missing. Therefore, without, yes, the fall back is nothing.

@ericpareja ericpareja self-assigned this Dec 1, 2024
@ericpareja
Copy link
Contributor

It appears that the culprit is an off-by-one error in common/printfile.cpp. I'll patch this and submit a PR.
If you want to fix it in your codebase, change the line towards the end of the file that reads:
return printfile_path(FilePath(dir, StrCat(base_fn, ".", os::random_number(screens))),
and change it to:
return printfile_path(FilePath(dir, StrCat(base_fn, ".", os::random_number(screens-1))),

@ericpareja
Copy link
Contributor

If I use a welcome.ans at all (within directory /wwiv/gfiles or /wwiv/menus/wwiv/gfiles) it ONLY displays welcome.ans. The random only appears to work IF the .ans extension is missing. Therefore, without, yes, the fall back is nothing.

i can't replicate this error where it won't display the randoms if welcome.ans is there. i'll open a different issue for this.

@the-godfather-007
Copy link
Author

Thank you for the fix. I added it to /common/printfile.cpp file. Curious which binary does this change that needs copied over and is there a master list of .cpp files and their associated binaries they compile into?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants