How a Round Works
dLottery always has exactly one open round. Players buy in, the timer runs down, a winner is drawn, and a fresh round opens immediately.
Lifecycle
Section titled βLifecycleβopen round β players buy tickets β timer reaches 0 β draw β new round opens- A round opens with a duration of
lossTimeand the currenttaxesPercent. On startup, an in-progress round is resumed from the database rather than restarted. - Players buy tickets (Buying Tickets), each adding to the shared pool (minus tax).
- The timer ends (or an admin runs
/lottery shuffle) and the round draws. - A new round opens straight away.
The draw
Section titled βThe drawβWhen a round draws, dLottery checks:
| Condition | Outcome |
|---|---|
| No tickets sold | No winner β βended with no tickets sold.β |
Fewer than minPlayers unique players |
No winner β everyone is refunded. |
| Otherwise | A winner is selected, weighted by ticket count. |
So a round only pays out if at least minPlayers different players took part. See Winning & Payouts for the weighting and prize.
Weighted odds
Section titled βWeighted oddsβWin chance is proportional to tickets held. If three players hold 1, 3 and 6 tickets (10 total), their odds are 10%, 30% and 60%. Buying more tickets is buying more chances β but never a guarantee.
Persistence
Section titled βPersistenceβEverything β the open round, every ticket, the pool, history and player stats β lives in MySQL, so a restart resumes exactly where it left off.