rename cracked to noauth and remove the possibility to self register as such
This commit is contained in:
@ -147,7 +147,7 @@
|
||||
<Select id="edition" bind:value={user.playertype} disabled={!user.edit} size="sm">
|
||||
<option value="java">Java Edition</option>
|
||||
<option value="bedrock">Bedrock Edition</option>
|
||||
<option value="cracked">Java cracked</option>
|
||||
<option value="noauth">Java noauth</option>
|
||||
</Select>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -16,7 +16,7 @@ export const POST = (async ({ request, cookies }) => {
|
||||
from: number | null;
|
||||
|
||||
name: string | null;
|
||||
playertype: 'java' | 'bedrock' | 'cracked' | null;
|
||||
playertype: 'java' | 'bedrock' | 'noauth' | null;
|
||||
|
||||
search: string | null;
|
||||
slim: boolean | null;
|
||||
|
@ -19,7 +19,7 @@
|
||||
<option value={null}>Alle</option>
|
||||
<option value="java">Java</option>
|
||||
<option value="beckdrock">Bedrock</option>
|
||||
<option value="cracked">Cracked</option>
|
||||
<option value="noauth">Noauth</option>
|
||||
</Select>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {
|
||||
getBedrockUuid,
|
||||
getCrackedUuid,
|
||||
getJavaUuid,
|
||||
getNoAuthUuid,
|
||||
UserNotFoundError
|
||||
} from '$lib/server/minecraft';
|
||||
import { error, type RequestHandler } from '@sveltejs/kit';
|
||||
@ -12,7 +12,7 @@ export const POST = (async ({ request }) => {
|
||||
|
||||
let uuid: string;
|
||||
try {
|
||||
// available playertypes are 'java', 'bedrock' and 'cracked'
|
||||
// available playertypes are 'java', 'bedrock' and 'noauth'
|
||||
switch (data.get('playertype')) {
|
||||
case 'java':
|
||||
uuid = await getJavaUuid(data.get('username') as string);
|
||||
@ -20,8 +20,8 @@ export const POST = (async ({ request }) => {
|
||||
case 'bedrock':
|
||||
uuid = await getBedrockUuid(data.get('username') as string);
|
||||
break;
|
||||
case 'cracked':
|
||||
uuid = getCrackedUuid(data.get('username') as string);
|
||||
case 'noauth':
|
||||
uuid = getNoAuthUuid(data.get('username') as string);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`invalid player type (${data.get('playertype')})`);
|
||||
|
@ -122,22 +122,7 @@
|
||||
>
|
||||
<option value="java">Java Edition</option>
|
||||
<option value="bedrock">Bedrock Edition</option>
|
||||
<option value="cracked">Java cracked</option>
|
||||
</Select>
|
||||
{#if playertype === 'cracked'}
|
||||
<div class="sm:col-span-2">
|
||||
<Input id="password" name="password" type="password" required={true}>
|
||||
<span slot="label">Passwort</span>
|
||||
<span slot="notice">
|
||||
Da Du cracked spielst, musst Du ein Passwort festlegen, mit welchem Du Dich auf dem
|
||||
Server authentifizierst! Das Passwort wird im Klartext gespeichert und ist in deinen
|
||||
Clientlogs sowie in Serverlogs für Admins sichtbar. Verwende daher ein neues Passwort,
|
||||
welches Du nirgends sonst verwendest! Merke Dir das Passwort gut, ohne kannst Du Dich
|
||||
nicht auf dem Server einloggen
|
||||
</span>
|
||||
</Input>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="divider" />
|
||||
<div class="mx-2 grid gap-y-3 mb-6">
|
||||
|
@ -13,7 +13,9 @@ export const POST = (async ({ request, url }) => {
|
||||
if (data.reporter == null || data.reason == null) return new Response(null, { status: 400 });
|
||||
|
||||
const reporter = await User.findOne({ where: { uuid: data.reporter } });
|
||||
const reported = data.reported ? await User.findOne({ where: { uuid: data.reported } }) : undefined;
|
||||
const reported = data.reported
|
||||
? await User.findOne({ where: { uuid: data.reported } })
|
||||
: undefined;
|
||||
|
||||
if (reporter == null || reported === null) return new Response(null, { status: 400 });
|
||||
|
||||
|
Reference in New Issue
Block a user