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

Added timeout flag #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awesomelemonade
Copy link

Bot timeouts are currently fixed at 2000 milliseconds. This flag allows one to change this constant for debugging purposes.

@lidavidm
Copy link
Contributor

There is already a flag to disable timeouts altogether, or does that not help for your purpose?

@awesomelemonade
Copy link
Author

Yeah I noticed that flag, but it doesn't help as I still want to limit the time to detect infinite loops. However, this flag does beg the question of whether to add a flag to change the initial 30 seconds.

@lidavidm
Copy link
Contributor

Fair enough.

The init flag is probably not as useful.

@@ -42,6 +42,7 @@ int main(int argc, char *argv[]) {
constants.DEFAULT_MAP_HEIGHT,
"positive integer", cmd);
ValueArg<unsigned int> seed_arg("s", "seed", "The seed for the map generator.", false, 0, "positive integer", cmd);
ValueArg<unsigned int> timeout_arg("", "timeout", "Bot timeouts in milliseconds.", false, 2000, "positive integer", cmd);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like 2000 to be in a single place as magic constant. Right now it's also in

std::chrono::milliseconds timeout = 2000ms; /**< The networking timeout duration. */

How about creating constexpr in NetworkingConfig.hpp with 2000 and refer to that here and in the NetworkingConfig struct instead?

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.

3 participants