refacto: Changing gameplay so teams don't know what the other team got + both teams can now chart the same cell without knowing + planet capture gameplay implemented
This commit is contained in:
@@ -111,4 +111,19 @@ export async function decrementUserActions(userId) {
|
||||
[userId]
|
||||
);
|
||||
return rows[0] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets ALL users' quota to a given value (used on world-seed wipeout).
|
||||
* Users who have no row yet get one inserted.
|
||||
*/
|
||||
export async function resetAllUserActions(actionsRemaining, quotaResetAt) {
|
||||
await usersPool.query(
|
||||
`INSERT INTO user_action_quota (user_id, actions_remaining, quota_reset_at)
|
||||
SELECT id, $1, $2 FROM users
|
||||
ON CONFLICT (user_id) DO UPDATE
|
||||
SET actions_remaining = $1,
|
||||
quota_reset_at = $2`,
|
||||
[actionsRemaining, quotaResetAt]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user