Skip to content

Latest commit

 

History

History
197 lines (168 loc) · 9.7 KB

GLOSSARY.md

File metadata and controls

197 lines (168 loc) · 9.7 KB

EventManager

EventManager plans gaming events for admins. It keeps a library of games and their activities, puts activities together into an event, and records which one won.

Language

Library

Library: Everything an Event can draw from: the Games, their Activities, and the Themes and Holidays used to tag those Activities.

Game: A game in the Library, with a name and optional image, icon and website links.

Activity: Something to play in one Game, with a description, rules and setup requirements, and optional players (a minimum and a maximum, each 1 to 99, the minimum at most the maximum) and duration (in minutes, 1 to 1440). Every Activity belongs to exactly one Game. An Activity with none of these set is still a whole Activity: nothing has to be filled in.

Theme: A named tag for Activities, such as Fantasy or Horror. An Activity can have any number of Themes.

Holiday: A named tag for Activities, such as Halloween. It is a label, not a date. An Activity can have any number of Holidays. A Series' holiday preset (such as Thanksgiving) is a built-in date rule, not a Holiday.

Themed activity: An Activity with at least one Theme or Holiday.

Comment: A dated, plain-text note about how an Activity went. An Activity has any number of Comments, each with its own added date, and each can be edited or deleted. A Comment written from an Event's details lands on the Activity that won that Event and records which Event it came from. This replaces the Activity's old single text field. Avoid: note, Activity comments

Events

Event: A named, dated gaming event made of one to five Selections, with at most one Winner. An Event that is an Occurrence may have zero Selections until they are rolled.

Selection: One Game and one of that Game's Activities chosen for an Event, stored as a snapshot of the Game and Activity as they were when the Selection was chosen. Editing the Event keeps that snapshot, even if the Game or Activity has since changed or been deleted, unless the user changes that slot. An Event may not have the same Activity in two Selections: a save that does is refused. The snapshot carries no Comments; Comments are records of their own, read live.

Unique games only: An Event setting, on by default. When it is on, every Selection in the Event uses a different Game.

Winner: The Selection that won the Event, identified by its Activity because a Game can appear in more than one Selection. An Event with exactly one Selection has that Selection as its Winner. Avoid: winning game

Event metrics: The optional numbers recorded about an Event after it was played: attendees, new attendees, returning attendees and amount spent. They belong to one Event and are kept apart from it, so editing the Event's Selections never changes them. Avoid: figures, attendance

Like: One visitor's thumbs-up for an Event, given through the Event's feedback link. A visitor address counts once per Event.

Offered: The number of Events whose Selections include an Activity, each Event counted once; only Events dated up to now count. The Stats page counts it for Games the same way. Beside it, "wins" stays a plain lowercase word, not a term: the number of those Events whose Winner is that Activity (or has that Game). Avoid: appearances, appeared in

Activity performance: How an Activity has done across every Event that offered it: Offered, wins, win rate, average Likes and average attendees of those Events. It is raw numbers, never a single score, and it is worked out when read, not stored. It cannot tell a weak Activity from a weak night, because an Event has several Selections.

slot: A position for one Selection while an Event is put together in the create or edit Event dialog. Re-rolling a slot gives it a different random Activity that matches the Filters and does not clash with the other slots, which stay unchanged. A Series' slot template holds how many slots, and which Filters, its Occurrences start with when rolled.

Filters: The choices that narrow which Activities can fill a slot: specific Games, Themes or Holidays, Themed activities only, and three more, each off by default:

  • players tonight: keeps an Activity unless its minimum or maximum players excludes that number; a missing bound is open.
  • longest duration: keeps an Activity with no duration or one within the limit.
  • avoid recent: skips Activities offered in the last N Events (1 to 10, 3 when turned on) dated before the date and time picked for the Event being planned, not counting the Event being edited. Only Events with at least one Selection count toward N. It skips Activities, never Games, and never relaxes itself: the message names it only when it is the cause, that is when the same roll without it would have something to pick. Players tonight and longest duration take a whole number within the limit of the matching Activity field (see Activity), avoid recent one from 1 to 10; anything else leaves that Filter off. None of the Filters is saved with the Event. Like the Game, Theme and Holiday Filters, players tonight and longest duration apply to Randomize All, re-roll, Add Activity Slot and the slot pickers; avoid recent applies to Randomize All, re-roll and Add Activity Slot, not to a slot changed by hand.

Announcement: Ready-to-paste Discord text for an Event, copied from its details with Copy announcement (#97). A fixed template, built from the Event as the details show it: the Event name as a bold title; the date as a Discord timestamp, so each reader sees their own time zone; then one line per Selection, in the Event's order, with its Game and Activity names and the players and duration its snapshot carries, the Winner's line ending in "🏆 Winner". Names only, never an Activity's description, rules or setup. An Event with no Selections yet says "The picks are still to come." A name cannot break the layout or mention anyone: its markdown characters and the brackets of a link are escaped, as is a heading or list marker it starts with (#, - or 1.), every @ is made inert, and a line break becomes a space. A line for a link to the Event is reserved and empty for now (#9).

Series: A recurrence rule with a start, a slot template (slot count, Filters and Unique games only) and an optional end, from which the app generates Occurrences ahead of time; the start is an anchor, and the first Occurrence is the first rule date at or after it, so a rule whose date the start is not falls later. Its rule is weekly, every other week, monthly on the nth weekday or on a date, yearly on a date, or yearly on a holiday preset (such as Thanksgiving or Easter). It is stored in its own table, apart from its Events; ADR 0002 records why.

Occurrence: An Event that belongs to a Series, generated for one instant of its rule (its occurrence key). It is an ordinary Event with its own Selections, Winner, Comments and Event metrics, and may have no Selections until they are rolled. Editing one by hand marks it Modified; a Modified, played (one with a Winner, Comments or Event metrics) or past Occurrence is never rewritten by an edit to its Series. Deleting one asks: This event only (it stays cancelled), or This and all future events (the Series is cancelled with its future, unplayed Occurrences). Update Event with nothing changed in the dialog asks nothing and sends nothing, so the Occurrence is not marked Modified. One that is Modified, has a Winner or is past shows "Series changes skip played, modified and past events." and saves as This event only with no question; one played only through Comments or Event metrics is still asked, and a Series change leaves it as it is. Otherwise a change to the name, date, time, Unique games only or Selections asks: This event only, This and following events, or All future events. The first Occurrence of its Series is offered only This event only and All future events (all three when its Series cannot be read). The two that reach the Series are offered only when nothing but the name, the time of day or Unique games only changed, and refuse a time that falls on another day at the Series' own UTC offset (This event only takes it); a changed date or changed Selections apply to this event only. This and following events starts the new Series on the day of the Occurrence's key. A changed Occurrence not yet rolled saves with no Selections.

Relationships

  • A Game has many Activities; each Activity belongs to one Game.
  • An Activity has zero or more Themes and zero or more Holidays.
  • An Event has one to five Selections; each Selection is one Game and one of its Activities. (An Occurrence may have zero.)
  • An Event has zero or one Winner, which is one of its Selections.
  • Each slot becomes one Selection when the Event is saved.
  • An Activity has zero or more Comments; a Comment may record the Event it was written from.
  • An Event has zero or one set of Event metrics.
  • Activity performance is built from the Event metrics and Likes of the Events that offered an Activity.
  • A Series has many Occurrences; an Occurrence is an Event.

Storage

Two admins editing the same Game, Activity, Theme, Holiday, Event or Comment cannot silently overwrite each other: every item carries an eTag, and a save or delete that sends it back as If-Match after someone else saved is refused with 409. An edit never brings back an item that was deleted in the meantime (404). See docs/api-validation.md.

An Event keeps its Selections as one JSON value. When that value is too long for a single Table Storage property it is stored in numbered chunks (Selections, Selections__1, ...) and joined again on read; older Events stored in one piece read back unchanged.