diff --git a/components/GameAppealCard.tsx b/components/GameAppealCard.tsx index f412c12..d5ed8f5 100644 --- a/components/GameAppealCard.tsx +++ b/components/GameAppealCard.tsx @@ -84,6 +84,10 @@ export default function (props: GameAppealProps & { port?: MessagePort }) { }> + + Appeal Type + {props.type} + Response: Explanation of Ban {props.what_happened} diff --git a/functions/api/game-appeals/[id]/accept.ts b/functions/api/game-appeals/[id]/accept.ts index 8523811..ef4c795 100644 --- a/functions/api/game-appeals/[id]/accept.ts +++ b/functions/api/game-appeals/[id]/accept.ts @@ -16,29 +16,49 @@ export async function onRequestPost(context: RequestContext) { if (!appeal) return jsonError("Appeal not found", 400); const banList = (await getBanList(context)) as { - [k: string]: { BanType: number; Unbanned?: boolean; UnbanReduct?: number }; + [k: string]: { + BanType: number; + hidden_from_leaderboards?: boolean; + serverconfigurator_blacklist?: boolean; + Unbanned?: boolean; + UnbanReduct?: number; + }; }; await context.env.D1.prepare("DELETE FROM game_appeals WHERE id = ?;") .bind(context.params.id) .run(); - if (!banList[appeal.roblox_id]) + if (!banList[appeal.roblox_id]?.BanType) return new Response(null, { status: 204, }); - banList[appeal.roblox_id] = { - BanType: 0, - Unbanned: true, - UnbanReduct: statsReduction, - }; + if (banList[appeal.roblox_id].BanType === 2) { + banList[appeal.roblox_id] = { + BanType: 0, + Unbanned: true, + UnbanReduct: statsReduction, + }; + } else if (appeal.type === "server configurator") { + banList[appeal.roblox_id] = { + ...banList[appeal.roblox_id], + serverconfigurator_blacklist: false, + }; + } else if (appeal.type === "blacklist") { + banList[appeal.roblox_id] = { + ...banList[appeal.roblox_id], + hidden_from_leaderboards: false, + Unbanned: true, + UnbanReduct: statsReduction, + }; + } await context.env.D1.prepare( "INSERT INTO game_mod_logs (action, evidence, executed_at, executor, id, target) VALUES (?, ?, ?, ?, ?, ?);", ) .bind( - "accept_appeal", + `accept appeal | ${banList[appeal.roblox_id]?.BanType === 2 ? "ban" : appeal.type}`, `https://carcrushers.cc/mod-queue?id=${context.params.id}&type=gma`, Date.now(), context.data.current_user.id, diff --git a/index.d.ts b/index.d.ts index c3b5eac..3096da7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -15,7 +15,7 @@ declare global { event_id: string; event_type: string; token: string; - } + }; type RequestContext = EventContext; @@ -39,6 +39,7 @@ declare global { reason_for_unban: string; roblox_id: number; roblox_username: string; + type: string; what_happened: string; }