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

Get rid of default starting time #1561

Open
ctm opened this issue Feb 10, 2025 · 0 comments
Open

Get rid of default starting time #1561

ctm opened this issue Feb 10, 2025 · 0 comments
Assignees
Labels
chore Maintenance or other non-bug, non-feature

Comments

@ctm
Copy link
Owner

ctm commented Feb 10, 2025

Make it so when a tournament is created, the starting time picker is not populated.

This is harder than it looks. The current code assumes that there will always be a default starting time, unless the tournament is going to be started by a particular number of players. Even then, a starting time is kept in the various data structures which even shows up in the call to EventRow::create, which has this code in it:

        if parameters.n_players_autostart.is_some() {
            start_at = None;
        } else if let Some(start_at) = start_at.as_mut() {
            Self::fix(start_at, start_at_minimum..=start_at_maximum);
        }

For non-demo event creation, the struct we use is NewEvent:

pub struct NewEvent {
    pub structure_short_name: String,
    pub comment: Option<String>,
    pub start_at: DateTime<Utc>,
    pub parameters: Parameters,
}

and start_at is not an Option. Pararmeters has an n_players_autostart field which is an Option<i32>. Currently, mb2 supports—in theory—the ability to have both a non-null start_at and a non-null n_players_autostart in the events table, with that telling mb2 to start whichever comes first, the starting time occurring or the given number of players registering. There is, however, no way to put that into the database through the UI, so if it's been used at all, it's been done via manual db manipulation, which is exceedingly rare.

The current creation code was a bit of a hack that hasn't been revisited. It has no UI for letting the creator know that a value is inappropriate for a field, so, for example if non-numeric characters are entered in a numeric-requiring input (e.g., "nn" in "Seconds to Act"), the Create button remains active and if clicked on, some default value will be used. As such, even if the creation code were hacked up to let us represent that a starting time hasn't been chosen, that wouldn't help in the least if clicking on Create simply used a default that the creator couldn't see.

Considering the above, it does not make sense to work on this issue any time soon. There are far too many higher priority issues. In fact, making the winner's default start-at always work (#1560) is way higher priority than this. The biggest reason for this issue to exist is to just document what I found while looking at how easy or hard it would be to get rid of the default.

@ctm ctm added the chore Maintenance or other non-bug, non-feature label Feb 10, 2025
@ctm ctm self-assigned this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance or other non-bug, non-feature
Projects
None yet
Development

No branches or pull requests

1 participant