+ Token drop
+
+ Give everyone online right now the same number of tokens. Each player gets a gift box with
+ your message on it; a player who isn't signed in when you press the button gets
+ nothing. Up to {MAX_TOKEN_DROP.toLocaleString()} tokens each.
+
+
+
+ )
+}
+
/**
* Change the account's username — the name used to sign in, here and in the game.
*
diff --git a/apps/www/src/staff.ts b/apps/www/src/staff.ts
index e0f3bbe..819b453 100644
--- a/apps/www/src/staff.ts
+++ b/apps/www/src/staff.ts
@@ -4,6 +4,7 @@ import {
clearPasswordHash,
createGift,
getAccount,
+ getOnlinePlayerIds,
getPlayerIdsInRoom,
getPresences,
movePlayerToDorm,
@@ -545,6 +546,17 @@ export const DEFAULT_MAX_TOKEN_GIFT = 10_000
*/
export const DEFAULT_MAX_XP_GIFT = 100
+/**
+ * The most a token DROP — the gift to everyone online at once — can carry per player. Fixed
+ * rather than an operator knob like `MAX_TOKEN_GIFT`, and far under it: this one is multiplied
+ * by however many players are on, and the drop is meant for a small thank-you to the whole
+ * server, not a payout.
+ */
+export const MAX_TOKEN_DROP = 1_000
+
+/** The longest message a token drop's box may carry — the same cap a client message has. */
+const MAX_TOKEN_DROP_MESSAGE = 256
+
/**
* `GiftContext.Purchased_Gift_A` — what a staff box says it came from.
*
@@ -735,12 +747,16 @@ function tokenAmountRefusal(c: Context