Skip to content

Commit 0357338

Browse files
committed
Ignore player names of excessive length
1 parent 4f5882d commit 0357338

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/db/functions/playerTimes25.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { eq } from "drizzle-orm";
22
import { db, playerTimes25Table } from "#db";
3+
import { log } from "#util";
34

45
export function getTimeData(data: typeof playerTimes25Table.$inferSelect) {
56
return Object.entries(data.servers).filter((x): x is [string, NonNullable<typeof x[1]>] => x[1] !== null);
67
}
78

89
export async function addPlayerTime(playerName: string, playerTime: number, serverAcro: string) {
10+
if (playerName.length > 99) return log("yellow", `Skipping addPlayerTime due to length: "${playerName}"`);
11+
912
const now = Math.floor(Date.now() / 1_000);
1013
const playerTimesData = await getPlayerTimesRow(playerName);
1114

0 commit comments

Comments
 (0)