Skip to content

managed event - make alt(subaccount) accounts which can tick checkboxes for specific "leagues" #14

@elysiumplain

Description

@elysiumplain

Example modes:

  • no-shop
  • no-upgrade-pillar
  • no-upgrade-card
  • ante (player bets a random card from their deck and gives it to the winner)
  • hardcore (when player loses, they lose random card from their deck)

managed event flow diagram:

  • codemasters submit event form (start_time, expiration_time, [event conditions])
  • create promocode in DB that on submit will add the flag to the submitting user's account
    • (we can pass the promocode forward to the event start promise and have that add the promocode to the DB only once the event is scheduled to start) ONLY if the account submitting the promocode passes the event conditions
  • return promocode to the creator so that they can distribute event invite ahead of schedule
  • app schedules event start promise
  • event start promise executes at event start_time and creates the event in the events_table with an expiration_timestamp and sets the event is_active=1.
    • Also responsible for scheduling the event expiration promise within the app which executes at event expiration_time
  • event expiration promise executes at event expiration_time which updates events_table and sets is_active=0

*promocode avenue allows using pre-existing accounts by adding the flag to the account
*if we only want to do brand new account events, then we can simply use the form and event start promise / event expiration promise to create/delete a new checkbox in the alts view and leave it at that...

something like a function call event_entry(flagID) when codemaster submits new event form:

returns trigger as $$
begin
  //creation of flag
  INSERT INTO events_table ... expiration_timestamp=..., is_active=1;
  RETURN NEW;
end;
$$ language plpgsql;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions