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 fix 1637 #1645

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Random welcome fix 1637 #1645

wants to merge 2 commits into from

Conversation

ericpareja
Copy link
Contributor

Fix off-by-one error on choosing a random screen to display
Fixes #1637

@ericpareja ericpareja requested a review from wwiv December 3, 2024 16:23
@the-godfather-007
Copy link

Fix worked. Welcome.ans file does not need to be in the /gfiles directory. just welcome.1 .2 .3 .4 etc..
When fake mailer / bot check is active it no longer aborts the random sequence after hitting the escape key (randomly) with this fix. After several attempts the fix cycles through random welcome.0-# instead. Fix compiles into bbs binary. (Answered my own question.)

@ericpareja
Copy link
Contributor Author

Fix worked. Welcome.ans file does not need to be in the /gfiles directory. just welcome.1 .2 .3 .4 etc.. When fake mailer / bot check is active it no longer aborts the random sequence after hitting the escape key (randomly) with this fix. After several attempts the fix cycles through random welcome.0-# instead. Fix compiles into bbs binary. (Answered my own question.)

Does this address #1644 ?

}
}
}
if (i) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet these two can be collapsed somehow, also isn't this already in an "if (i)" block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in prior section of code, "i = 0" can make this next section not fire off.

@@ -256,7 +256,8 @@ void Output::print_local_file(const std::string& data) {

bool Output::printfile_random(const std::string& data) {
const printfile_opts opts(sess(), *this, data, true, true);
const auto& dir = sess().dirs().current_menu_gfiles_directory();
// const auto& dir = sess().dirs().current_menu_gfiles_directory();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will this break?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can nix this. currently printfile_random and printfile default to using gfiles/menus/wwiv/gfiles/, which permits multiple menu configs. i was simplifying to just use gfiles/ directly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think the right behavior here is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the current_menu_gfiles_directory() first if the file exists there, then check gfiles directory... i'll rework this.

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 this pull request may close these issues.

Random welcome.ans files not working as they should
3 participants