Compare commits
54 Commits
Eventplan-
...
a2456c8b46
| Author | SHA1 | Date | |
|---|---|---|---|
| a2456c8b46 | |||
| 0952035091 | |||
|
|
9c8c02f679 | ||
|
|
3b5fdc57c0 | ||
|
|
733c63946f | ||
| fd846250ab | |||
|
|
17460772e9 | ||
|
|
9a20860072 | ||
| 8f51723a3b | |||
| 8ad2f283aa | |||
| 39f1af8b73 | |||
| 266c4cb4ea | |||
| f3df3c0000 | |||
|
|
cb78fc598b | ||
| ba7ecc1a8e | |||
| 6ea92f9383 | |||
|
|
998770bf59 | ||
| a231032555 | |||
| 3aa3731bcb | |||
| 5e80c95bfd | |||
|
|
09dc28b6da | ||
|
|
fd7cf716ca | ||
| 73bd6a5e96 | |||
| 9c02cc1f4d | |||
| de8457fe45 | |||
| bccd5eb5a0 | |||
| 53afe70b27 | |||
| 4bbdaa06a9 | |||
| f03867b9a7 | |||
| 23e10eef0f | |||
| 4c72f4f26b | |||
| 624ba7f296 | |||
|
|
d7d20e4347 | ||
|
|
43bd8f4a7c | ||
|
|
18e8627b54 | ||
|
|
0efc46c7e2 | ||
| 62fff0c0b2 | |||
|
|
86b479fb28 | ||
|
|
489402292d | ||
| b53ce04a75 | |||
| 069a9973a4 | |||
| c3410de1d7 | |||
| a23c514102 | |||
| bf8110af6c | |||
| 349f71af1c | |||
| dda37127ca | |||
| 6d210eb0ff | |||
|
|
cfede8f299 | ||
|
|
597153ed39 | ||
|
|
697e903a26 | ||
| 1433784369 | |||
| 2c63a33bda | |||
| 87265e5ccc | |||
| 75f1a6528b |
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.jpg filter=lfs diff=lfs merge=lfs -text
|
||||||
|
.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
.glb filter=lfs diff=lfs merge=lfs -text
|
||||||
@@ -7,7 +7,6 @@ import sitemap from "@astrojs/sitemap";
|
|||||||
import robotsTxt from "astro-robots-txt";
|
import robotsTxt from "astro-robots-txt";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import mdx from "@astrojs/mdx";
|
import mdx from "@astrojs/mdx";
|
||||||
import pagefind from "astro-pagefind";
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -22,7 +21,6 @@ export default defineConfig({
|
|||||||
tailwind({
|
tailwind({
|
||||||
configFile: "./tailwind.config.cjs",
|
configFile: "./tailwind.config.cjs",
|
||||||
}),
|
}),
|
||||||
pagefind(),
|
|
||||||
configureI18n(),
|
configureI18n(),
|
||||||
sitemap({
|
sitemap({
|
||||||
i18n: {
|
i18n: {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {t} from "astro-i18n";
|
import {t} from "astro-i18n";
|
||||||
import {statsRepo} from "@repo/stats.ts";
|
import {statsRepo} from "@repo/stats.ts";
|
||||||
|
import "@styles/table.css"
|
||||||
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -64,7 +65,3 @@
|
|||||||
<p>{error.message}</p>
|
<p>{error.message}</p>
|
||||||
{/await}
|
{/await}
|
||||||
|
|
||||||
<style>
|
|
||||||
@import "../styles/table.css";
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{#each window(event.fights.filter(f => f.group === group), rows) as fights}
|
{#each window(event.fights.filter(f => group === undefined ? true : f.group === group), rows) as fights}
|
||||||
<tr>
|
<tr>
|
||||||
{#each fights as fight (fight.id)}
|
{#each fights as fight (fight.id)}
|
||||||
<td>{Intl.DateTimeFormat(astroI18n.locale, {
|
<td>{Intl.DateTimeFormat(astroI18n.locale, {
|
||||||
|
|||||||
@@ -31,8 +31,7 @@
|
|||||||
let error: string = $state("");
|
let error: string = $state("");
|
||||||
|
|
||||||
async function login() {
|
async function login() {
|
||||||
let {tokenStore} = await import("./repo/repo.ts");
|
let {authV2Repo} = await import("./repo/authv2.ts");
|
||||||
let {authRepo} = await import("./repo/auth.ts");
|
|
||||||
if (username === "" || pw === "") {
|
if (username === "" || pw === "") {
|
||||||
pw = "";
|
pw = "";
|
||||||
error = t("login.error");
|
error = t("login.error");
|
||||||
@@ -40,15 +39,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let auth = await get(authRepo).login(username, pw);
|
let auth = await get(authV2Repo).login(username, pw);
|
||||||
if (auth == undefined) {
|
if (!auth) {
|
||||||
pw = "";
|
pw = "";
|
||||||
error = t("login.error");
|
error = t("login.error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenStore.set(auth);
|
await navigate(l("/dashboard"));
|
||||||
navigate(l("/dashboard"));
|
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
pw = "";
|
pw = "";
|
||||||
error = t("login.error");
|
error = t("login.error");
|
||||||
|
|||||||
@@ -23,24 +23,35 @@
|
|||||||
import {t} from "astro-i18n";
|
import {t} from "astro-i18n";
|
||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
import {onMount} from "svelte";
|
import {onMount} from "svelte";
|
||||||
|
import {loggedIn} from "@repo/authv2.ts";
|
||||||
interface Props {
|
interface Props {
|
||||||
logo?: import('svelte').Snippet;
|
logo?: import('svelte').Snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { logo }: Props = $props();
|
let { logo }: Props = $props();
|
||||||
|
|
||||||
let navbar: HTMLDivElement = $state();
|
let navbar = $state<HTMLDivElement>();
|
||||||
let searchOpen = $state(false);
|
let searchOpen = $state(false);
|
||||||
|
|
||||||
|
let accountBtn = $state<HTMLAnchorElement>();
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
if ($loggedIn) {
|
||||||
|
accountBtn!.href = l("/dashboard");
|
||||||
|
} else {
|
||||||
|
accountBtn!.href = l("/login");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
handleScroll();
|
handleScroll();
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
if (window.scrollY > 0) {
|
if (window.scrollY > 0) {
|
||||||
navbar.classList.add("before:scale-y-100");
|
navbar!.classList.add("before:scale-y-100");
|
||||||
} else {
|
} else {
|
||||||
navbar.classList.remove("before:scale-y-100");
|
navbar!.classList.remove("before:scale-y-100");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -90,6 +101,8 @@
|
|||||||
<a href={l("/rules/microwargear")}
|
<a href={l("/rules/microwargear")}
|
||||||
class="btn btn-gray">{t("navbar.links.rules.micro")}</a>
|
class="btn btn-gray">{t("navbar.links.rules.micro")}</a>
|
||||||
<a href={l("/rules/streetfight")} class="btn btn-gray">{t("navbar.links.rules.sf")}</a>
|
<a href={l("/rules/streetfight")} class="btn btn-gray">{t("navbar.links.rules.sf")}</a>
|
||||||
|
<h2 class="px-2 text-gray-300">{t("navbar.links.rules.ranked")}</h2>
|
||||||
|
<a href={l("/rangliste/missilewars")} class="btn btn-gray">{t("navbar.links.ranked.mw")}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO: Add help center
|
<!-- TODO: Add help center
|
||||||
@@ -106,7 +119,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<a class="btn" href={l("/login")}>
|
<a class="btn" href={l("/login")} bind:this={accountBtn}>
|
||||||
<span class="btn__text">{t("navbar.links.account")}</span>
|
<span class="btn__text">{t("navbar.links.account")}</span>
|
||||||
</a>
|
</a>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import {CollectionEntry} from "astro:content";
|
import type {CollectionEntry} from "astro:content";
|
||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
import {astroI18n} from "astro-i18n";
|
import {astroI18n} from "astro-i18n";
|
||||||
import {Image} from "astro:assets";
|
import {Image} from "astro:assets";
|
||||||
|
|||||||
@@ -22,38 +22,40 @@
|
|||||||
import wrap from "svelte-spa-router/wrap";
|
import wrap from "svelte-spa-router/wrap";
|
||||||
import Router, {replace} from "svelte-spa-router";
|
import Router, {replace} from "svelte-spa-router";
|
||||||
import {get} from "svelte/store";
|
import {get} from "svelte/store";
|
||||||
import {tokenStore} from "@repo/repo";
|
import {loggedIn} from "@repo/authv2.ts";
|
||||||
|
|
||||||
const routes: RouteDefinition = {
|
const routes: RouteDefinition = {
|
||||||
"/": wrap({asyncComponent: () => import("./pages/Home.svelte"), conditions: detail => get(tokenStore) != ""}),
|
"/": wrap({asyncComponent: () => import("./pages/Home.svelte"), conditions: detail => get(loggedIn)}),
|
||||||
"/perms": wrap({
|
"/perms": wrap({
|
||||||
asyncComponent: () => import("./pages/Perms.svelte"),
|
asyncComponent: () => import("./pages/Perms.svelte"),
|
||||||
conditions: detail => get(tokenStore) != ""
|
conditions: detail => get(loggedIn)
|
||||||
}),
|
}),
|
||||||
"/login": wrap({
|
"/login": wrap({
|
||||||
asyncComponent: () => import("./pages/Login.svelte"),
|
asyncComponent: () => import("./pages/Login.svelte"),
|
||||||
conditions: detail => get(tokenStore) == ""
|
conditions: detail => !get(loggedIn)
|
||||||
}),
|
}),
|
||||||
"/event/:id": wrap({
|
"/event/:id": wrap({
|
||||||
asyncComponent: () => import("./pages/Event.svelte"),
|
asyncComponent: () => import("./pages/Event.svelte"),
|
||||||
conditions: detail => get(tokenStore) != ""
|
conditions: detail => get(loggedIn)
|
||||||
}),
|
}),
|
||||||
"/event/:id/generate": wrap({
|
"/event/:id/generate": wrap({
|
||||||
asyncComponent: () => import("./pages/Generate.svelte"),
|
asyncComponent: () => import("./pages/Generate.svelte"),
|
||||||
conditions: detail => get(tokenStore) != ""
|
conditions: detail => get(loggedIn)
|
||||||
}),
|
}),
|
||||||
"/edit": wrap({
|
"/edit": wrap({
|
||||||
asyncComponent: () => import("./pages/Edit.svelte"),
|
asyncComponent: () => import("./pages/Edit.svelte"),
|
||||||
conditions: detail => get(tokenStore) != ""
|
conditions: detail => get(loggedIn)
|
||||||
}),
|
}),
|
||||||
"/display/:event": wrap({
|
"/display/:event": wrap({
|
||||||
asyncComponent: () => import("./pages/Display.svelte"),
|
asyncComponent: () => import("./pages/Display.svelte"),
|
||||||
conditions: detail => get(tokenStore) != ""
|
conditions: detail => get(loggedIn)
|
||||||
}),
|
}),
|
||||||
"*": wrap({asyncComponent: () => import("./pages/NotFound.svelte")})
|
"*": wrap({asyncComponent: () => import("./pages/NotFound.svelte")})
|
||||||
};
|
};
|
||||||
|
|
||||||
function conditionsFailed(event: ConditionsFailedEvent) {
|
function conditionsFailed(event: ConditionsFailedEvent) {
|
||||||
|
console.log(event)
|
||||||
|
|
||||||
if (event.detail.location === "/login") {
|
if (event.detail.location === "/login") {
|
||||||
replace("/");
|
replace("/");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
import type {Player} from "@type/data.ts";
|
import type {Player} from "@type/data.ts";
|
||||||
import {l} from "@utils/util.ts";
|
import {l} from "@utils/util.ts";
|
||||||
import Statistics from "./Statistics.svelte";
|
import Statistics from "./Statistics.svelte";
|
||||||
import {authRepo} from "@repo/auth.ts";
|
import {authV2Repo} from "@repo/authv2.ts";
|
||||||
import {tokenStore} from "@repo/repo.ts";
|
|
||||||
import Card from "@components/Card.svelte";
|
import Card from "@components/Card.svelte";
|
||||||
|
import {navigate} from "astro:transitions/client";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
user: Player;
|
user: Player;
|
||||||
@@ -33,9 +33,8 @@
|
|||||||
let { user }: Props = $props();
|
let { user }: Props = $props();
|
||||||
|
|
||||||
async function logout() {
|
async function logout() {
|
||||||
await $authRepo.logout()
|
await $authV2Repo.logout();
|
||||||
tokenStore.set("")
|
await navigate(l("/login"));
|
||||||
window.location.href = l("/login")
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 SteamWar.de-Serverteam
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {fetchWithToken, tokenStore} from "./repo.ts";
|
|
||||||
import {derived} from "svelte/store";
|
|
||||||
|
|
||||||
export class AuthRepo {
|
|
||||||
constructor(private token: string) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public async login(username: string, password: string): Promise<string> {
|
|
||||||
return await fetchWithToken(this.token, "/auth/login", {
|
|
||||||
body: JSON.stringify({
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
}),
|
|
||||||
method: "POST",
|
|
||||||
}).then(value => value.json()).then(value => value.token);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async logout(): Promise<void> {
|
|
||||||
await fetchWithToken(this.token, "/auth/tokens/logout", {
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const authRepo = derived(tokenStore, ($token) => new AuthRepo($token));
|
|
||||||
184
src/components/repo/authv2.ts
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {readable, writable} from "svelte/store";
|
||||||
|
import dayjs, {type Dayjs} from "dayjs";
|
||||||
|
import {type AuthToken, AuthTokenSchema} from "@type/auth.ts";
|
||||||
|
|
||||||
|
export class AuthV2Repo {
|
||||||
|
private accessToken: string | undefined;
|
||||||
|
private accessTokenExpires: Dayjs | undefined;
|
||||||
|
private refreshToken: string | undefined;
|
||||||
|
private refreshTokenExpires: Dayjs | undefined;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
if (typeof localStorage === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.accessToken = localStorage.getItem("sw-access-token") ?? undefined;
|
||||||
|
if (this.accessToken) {
|
||||||
|
this.accessTokenExpires = dayjs(localStorage.getItem("sw-access-token-expires") ?? "");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.refreshToken = localStorage.getItem("sw-refresh-token") ?? undefined;
|
||||||
|
if (this.refreshToken) {
|
||||||
|
loggedIn.set(true);
|
||||||
|
this.refreshTokenExpires = dayjs(localStorage.getItem("sw-refresh-token-expires") ?? "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async login(name: string, password: string) {
|
||||||
|
if (this.accessToken !== undefined || this.refreshToken !== undefined) {
|
||||||
|
throw new Error("Already logged in");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const login = await this.request("/auth", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
name,
|
||||||
|
password,
|
||||||
|
keepLoggedIn: true,
|
||||||
|
}),
|
||||||
|
}).then(value => value.json()).then(value => AuthTokenSchema.parse(value));
|
||||||
|
|
||||||
|
this.setLoginState(login);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async logout() {
|
||||||
|
if (this.accessToken === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.request("/auth", {
|
||||||
|
method: "DELETE",
|
||||||
|
});
|
||||||
|
|
||||||
|
this.resetAccessToken();
|
||||||
|
this.resetRefreshToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
private setLoginState(tokens: AuthToken) {
|
||||||
|
this.setAccessToken(tokens.accessToken.token, dayjs(tokens.accessToken.expires));
|
||||||
|
this.setRefreshToken(tokens.refreshToken.token, dayjs(tokens.refreshToken.expires));
|
||||||
|
loggedIn.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private setAccessToken(token: string, expires: Dayjs) {
|
||||||
|
this.accessToken = token;
|
||||||
|
this.accessTokenExpires = expires;
|
||||||
|
localStorage.setItem("sw-access-token", token);
|
||||||
|
localStorage.setItem("sw-access-token-expires", expires.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private resetAccessToken() {
|
||||||
|
if (this.accessToken === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.accessToken = undefined;
|
||||||
|
this.accessTokenExpires = undefined;
|
||||||
|
localStorage.removeItem("sw-access-token");
|
||||||
|
localStorage.removeItem("sw-access-token-expires");
|
||||||
|
}
|
||||||
|
|
||||||
|
private setRefreshToken(token: string, expires: Dayjs) {
|
||||||
|
this.refreshToken = token;
|
||||||
|
this.refreshTokenExpires = expires;
|
||||||
|
localStorage.setItem("sw-refresh-token", token);
|
||||||
|
localStorage.setItem("sw-refresh-token-expires", expires.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private resetRefreshToken() {
|
||||||
|
if (this.refreshToken === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.refreshToken = undefined;
|
||||||
|
this.refreshTokenExpires = undefined;
|
||||||
|
localStorage.removeItem("sw-refresh-token");
|
||||||
|
localStorage.removeItem("sw-refresh-token-expires");
|
||||||
|
|
||||||
|
loggedIn.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async refresh() {
|
||||||
|
if (this.refreshToken === undefined || this.refreshTokenExpires === undefined || this.refreshTokenExpires.isBefore(dayjs().add(10, "seconds"))) {
|
||||||
|
this.resetRefreshToken();
|
||||||
|
this.resetAccessToken();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.requestWithToken(this.refreshToken!, "/auth", {
|
||||||
|
method: "PUT",
|
||||||
|
}).then(value => {
|
||||||
|
if (value.status === 401) {
|
||||||
|
this.resetRefreshToken();
|
||||||
|
this.resetAccessToken();
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.json();
|
||||||
|
}).then(value => AuthTokenSchema.parse(value));
|
||||||
|
|
||||||
|
this.setLoginState(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
async request(url: string, params: RequestInit = {}, retryCount: number = 0) {
|
||||||
|
if (this.accessToken !== undefined && this.accessTokenExpires !== undefined && this.accessTokenExpires.isBefore(dayjs().add(10, "seconds"))) {
|
||||||
|
await this.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.requestWithToken(this.accessToken ?? "", url, params, retryCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async requestWithToken(token: string, url: string, params: RequestInit = {}, retryCount: number = 0): Promise<Response> {
|
||||||
|
if (retryCount >= 3) {
|
||||||
|
throw new Error("Too many retries");
|
||||||
|
}
|
||||||
|
|
||||||
|
return fetch(`${import.meta.env.PUBLIC_API_SERVER}${url}`, {...params,
|
||||||
|
headers: {
|
||||||
|
...(token !== "" ? {"Authorization": "Bearer " + (token)} : {}),
|
||||||
|
"Content-Type": "application/json", ...params.headers,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(async value => {
|
||||||
|
if (value.status === 401 && url !== "/auth") {
|
||||||
|
try {
|
||||||
|
await this.refresh();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
} catch (_e) { /* empty */ }
|
||||||
|
|
||||||
|
return this.request(url, params, retryCount + 1);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const loggedIn = writable(false);
|
||||||
|
|
||||||
|
export const authV2Repo = readable(new AuthV2Repo());
|
||||||
@@ -17,31 +17,9 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {writable} from "svelte/store";
|
import {get, writable} from "svelte/store";
|
||||||
|
import {authV2Repo} from "@repo/authv2.ts";
|
||||||
|
|
||||||
export const fetchWithToken = (token: string, url: string, params: RequestInit = {}) =>
|
export const fetchWithToken = (token: string, url: string, params: RequestInit = {}) => get(authV2Repo).request(url, params);
|
||||||
fetch(`${import.meta.env.PUBLIC_API_SERVER}${url}`, {...params,
|
|
||||||
headers: {
|
|
||||||
...(token !== "" ? {"Authorization": "Bearer " + (token)} : {}),
|
|
||||||
"Content-Type": "application/json", ...params.headers,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.then(value => {
|
|
||||||
if (value.status === 401) {
|
|
||||||
tokenStore.set("");
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
});
|
|
||||||
|
|
||||||
export function getLocalStorage() {
|
export const tokenStore = writable("");
|
||||||
if (typeof localStorage === "undefined") {
|
|
||||||
return {
|
|
||||||
getItem: () => "",
|
|
||||||
setItem: () => {},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return localStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const tokenStore = writable((getLocalStorage().getItem("sw-session") ?? ""));
|
|
||||||
tokenStore.subscribe((value) => getLocalStorage().setItem("sw-session", value));
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export class StatsRepo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async getUserStats(id: string): Promise<UserStats> {
|
public async getUserStats(id: string): Promise<UserStats> {
|
||||||
return await fetchWithToken(this.token, `/stats/user/${id}`).then(value => value.json()).then(UserStatsSchema.parse);
|
return await fetchWithToken(this.token, `/stats/user`).then(value => value.json()).then(UserStatsSchema.parse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
src/components/types/auth.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {z} from "zod";
|
||||||
|
|
||||||
|
export const TokenSchema = z.object({
|
||||||
|
token: z.string(),
|
||||||
|
expires: z.string(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export type Token = z.infer<typeof TokenSchema>;
|
||||||
|
|
||||||
|
export const AuthTokenSchema = z.object({
|
||||||
|
accessToken: TokenSchema,
|
||||||
|
refreshToken: TokenSchema,
|
||||||
|
});
|
||||||
|
|
||||||
|
export type AuthToken = z.infer<typeof AuthTokenSchema>;
|
||||||
46
src/content/announcements/de/missilewars-iii-eventplan.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
title: MissileWars III Eventplan
|
||||||
|
key: missilewars3-eventplan
|
||||||
|
description: Der Eventplan für MissileWars 3
|
||||||
|
created: 2025-02-23
|
||||||
|
tags:
|
||||||
|
- event
|
||||||
|
- missilewars
|
||||||
|
---
|
||||||
|
|
||||||
|
### Infos:
|
||||||
|
Eventleitung: TheBreadBeard
|
||||||
|
|
||||||
|
Fights werden nach Möglichkeit mit einer Pause von 10 Minuten vorverschoben.
|
||||||
|
# Gruppenphase
|
||||||
|
## Punkte aus der Gruppenphase
|
||||||
|
|
||||||
|
<group-table data-event="67"> </group-table>
|
||||||
|
|
||||||
|
### Fights
|
||||||
|
|
||||||
|
| Start | Teams |
|
||||||
|
|-------|------------|
|
||||||
|
| 16:00:00 | KT vs Borg |
|
||||||
|
| 16:00:30 | VI vs FK |
|
||||||
|
| 16:30:00 | FK vs KT |
|
||||||
|
| 16:30:30 | Hlcy vs VI |
|
||||||
|
| 17:00:00 | VI vs KT |
|
||||||
|
| 17:00:30 | Borg vs Hlcy |
|
||||||
|
| 17:30:00 | KT vs Hlcy|
|
||||||
|
| 17:30:30 | FK vs Borg |
|
||||||
|
| 18:00:00 | VI vs Borg |
|
||||||
|
| 18:00:30 | FK vs Hlcy |
|
||||||
|
|
||||||
|
## KO-Phase
|
||||||
|
|
||||||
|
| Start | Teams |
|
||||||
|
|-------|------------|
|
||||||
|
| 17:50:00 | VI vs Borg |
|
||||||
|
| 18:20:00 | Hlcy vs FK |
|
||||||
|
| 18:22:00 | VI vs FK |
|
||||||
|
| 18:44:00 | Hlcy vs Borg |
|
||||||
|
|
||||||
|
## Ergebnisse
|
||||||
|
|
||||||
|
<fight-table data-event="67" data-group="Gruppe 1"> </fight-table>
|
||||||
105
src/content/announcements/de/wgs25-kampfplan.md
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
---
|
||||||
|
title: WGS 2025 Kampfplan
|
||||||
|
description: WGS 2025 Kampfplan
|
||||||
|
key: wgs-2025-kampfplan
|
||||||
|
created: 2025-03-01
|
||||||
|
tags:
|
||||||
|
- event
|
||||||
|
- wargear
|
||||||
|
---
|
||||||
|
|
||||||
|
# WGS 2025 Kampfplan
|
||||||
|
|
||||||
|
### Platzierung
|
||||||
|
|
||||||
|
| Platzierung | Team | Punkte |
|
||||||
|
|-------------|-------------|--------|
|
||||||
|
| 1. | Halcyon | 7 |
|
||||||
|
| 2. | Happy-End | 6 |
|
||||||
|
| 3. | ABYSS | 4 |
|
||||||
|
| 4. | Borg | 3 |
|
||||||
|
| 5. | TheNoobTeam | 1 |
|
||||||
|
| 6. | BlackFire | 0 |
|
||||||
|
|
||||||
|
### Aktueller Spieltag
|
||||||
|
|
||||||
|
<fight-table data-event="68"></fight-table>
|
||||||
|
|
||||||
|
### Qualifikation
|
||||||
|
|
||||||
|
| 01.03.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|--------------|----------|
|
||||||
|
| 19:00 | HPY vs ABYS | HPY qualifiziert |
|
||||||
|
| 19:30 | Borg vs Hlcy | Hlcy qualifiziert |
|
||||||
|
| 20:00 | TNT vs BF | TNT qualifiziert |
|
||||||
|
| 20:30 | ABYS vs Borg | Sieg ABYS |
|
||||||
|
| 21:00 | Borg vs BF | Sieg Borg |
|
||||||
|
| 21:30 | BF vs ABYS | ABYS, Borg qualifiziert |
|
||||||
|
|
||||||
|
PL hat sich nach der Qualifikation zurückgezogen, womit BF nachgerückt ist.
|
||||||
|
|
||||||
|
### 1. Spieltag
|
||||||
|
|
||||||
|
| 08.03.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|--------------|----------|
|
||||||
|
| 19:00 | ABYS vs Borg | Sieg ABYS |
|
||||||
|
| 19:30 | Hlcy vs HPY | Sieg Hlcy |
|
||||||
|
| 20:00 | BF vs TNT | Sieg TNT |
|
||||||
|
| 20:30 | HPY vs ABYS | Sieg HPY |
|
||||||
|
| 21:00 | Borg vs BF | Sieg Borg |
|
||||||
|
| 21:30 | TNT vs Hlcy | Sieg Hlcy |
|
||||||
|
|
||||||
|
### 2. Spieltag
|
||||||
|
|
||||||
|
| 15.03.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|--------------|----------|
|
||||||
|
| 19:00 | HPY vs TNT | Sieg HPY |
|
||||||
|
| 19:30 | ABYS vs BF | Sieg ABYS |
|
||||||
|
| 20:00 | Borg vs Hlcy | Sieg Hlcy |
|
||||||
|
| 20:30 | BF vs HPY | Sieg HPY |
|
||||||
|
| 21:00 | TNT vs Borg | Sieg Borg |
|
||||||
|
| 21:30 | Hlcy vs ABYS | Sieg Hlcy |
|
||||||
|
|
||||||
|
### 3. Spieltag
|
||||||
|
|
||||||
|
| 22.03.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|-------------|----------|
|
||||||
|
| 19:00 | ABYS vs TNT | Sieg ABYS |
|
||||||
|
| 19:30 | Borg vs HPY | Sieg HPY |
|
||||||
|
| 20:00 | Hlcy vs BF | Sieg Hlcy |
|
||||||
|
| 20:30 | - | / |
|
||||||
|
| 21:00 | - | / |
|
||||||
|
| 21:30 | - | / |
|
||||||
|
|
||||||
|
### 4. Spieltag
|
||||||
|
|
||||||
|
| 29.03.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|--------------|----------|
|
||||||
|
| 19:00 | TNT vs ABYS | Sieg ABYS |
|
||||||
|
| 19:30 | HPY vs Borg | Sieg HPY |
|
||||||
|
| 20:00 | BF vs Hlcy | Sieg Hlcy |
|
||||||
|
| 20:30 | Borg vs TNT | Sieg Borg |
|
||||||
|
| 21:00 | HPY vs BF | Sieg HPY |
|
||||||
|
| 21:30 | ABYS vs Hlcy | Sieg Hlcy |
|
||||||
|
|
||||||
|
### 5. Spieltag
|
||||||
|
|
||||||
|
| 05.04.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|--------------|----------|
|
||||||
|
| 19:00 | TNT vs HPY | / |
|
||||||
|
| 19:30 | BF vs ABYS | / |
|
||||||
|
| 20:00 | Hlcy vs Borg | / |
|
||||||
|
| 20:30 | ABYS vs HPY | / |
|
||||||
|
| 21:00 | BF vs Borg | / |
|
||||||
|
| 21:30 | Hlcy vs TNT | / |
|
||||||
|
|
||||||
|
### 6. Spieltag
|
||||||
|
|
||||||
|
| 12.04.2025 | Begegnung | Ergebnis |
|
||||||
|
|------------|--------------|----------|
|
||||||
|
| 19:00 | Borg vs ABYS | / |
|
||||||
|
| 19:30 | HPY vs Hlcy | / |
|
||||||
|
| 20:00 | TNT vs BF | / |
|
||||||
|
| 20:30 | - | / |
|
||||||
|
| 21:00 | - | / |
|
||||||
|
| 21:30 | - | / |
|
||||||
@@ -4,7 +4,8 @@
|
|||||||
"url": {
|
"url": {
|
||||||
"1.21.4": "https://git.steamwar.de/SteamWar/AdvancedScripts/releases/download/2.2.0/AdvancedScripts-2.2.0.jar",
|
"1.21.4": "https://git.steamwar.de/SteamWar/AdvancedScripts/releases/download/2.2.0/AdvancedScripts-2.2.0.jar",
|
||||||
"1.20.6": "https://git.steamwar.de/SteamWar/AdvancedScripts/releases/download/2.1.0/AdvancedScripts-2.1.0.jar",
|
"1.20.6": "https://git.steamwar.de/SteamWar/AdvancedScripts/releases/download/2.1.0/AdvancedScripts-2.1.0.jar",
|
||||||
"1.19.3": "https://git.steamwar.de/SteamWar/AdvancedScripts/releases/download/2.0.0/AdvancedScripts-2.0.0.jar"
|
"1.19.3": "https://git.steamwar.de/SteamWar/AdvancedScripts/releases/download/2.0.0/AdvancedScripts-2.0.0.jar",
|
||||||
|
"Hotkey script": "https://git.steamwar.de/SteamWar/SteamWar/src/branch/main/BauSystem/hotkeys.lua"
|
||||||
},
|
},
|
||||||
"sourceUrl": "https://git.steamwar.de/SteamWar/AdvancedScripts"
|
"sourceUrl": "https://git.steamwar.de/SteamWar/AdvancedScripts"
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
"name": "SteamWarTeamserver",
|
"name": "SteamWarTeamserver",
|
||||||
"description": "Dieses Plugin ermöglicht die einfache Einbindung deines Servers in SteamWar. Wie du deinen (Team-)Server über SteamWar erreichbar machen kannst findest du hier.",
|
"description": "Dieses Plugin ermöglicht die einfache Einbindung deines Servers in SteamWar. Wie du deinen (Team-)Server über SteamWar erreichbar machen kannst findest du hier.",
|
||||||
"url": {
|
"url": {
|
||||||
"Info": "/teamserverintegration"
|
"Info": "/teamserverintegration",
|
||||||
|
"Download": "https://git.steamwar.de/SteamWar/SteamWarTeamserverIntegration/releases/download/latest/SteamWarTeamserverIntegration.jar"
|
||||||
},
|
},
|
||||||
"sourceUrl": "https://git.steamwar.de/SteamWar/SteamWarBungeeTeamserver"
|
"sourceUrl": "https://git.steamwar.de/SteamWar/SteamWarTeamserverIntegration"
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"translationKey": "microwg",
|
"translationKey": "microwg",
|
||||||
"main": false
|
"main": false,
|
||||||
|
"ranked": true
|
||||||
}
|
}
|
||||||
5
src/content/modes/missilewars.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"translationKey": "mw",
|
||||||
|
"main": false,
|
||||||
|
"ranked": true
|
||||||
|
}
|
||||||
BIN
src/content/pages/de/Lieutenant2.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/content/pages/de/STEAMIE.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/content/pages/de/STEAMIE2.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/content/pages/de/captain2.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/content/pages/de/commander2.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
src/content/pages/de/key1.png
Normal file
|
After Width: | Height: | Size: 922 B |
BIN
src/content/pages/de/key2-2.png
Normal file
|
After Width: | Height: | Size: 1000 B |
BIN
src/content/pages/de/key3-2.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
178
src/content/pages/de/shop.md
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
---
|
||||||
|
title: Shop
|
||||||
|
description: Shop
|
||||||
|
slug: shop
|
||||||
|
slugs:
|
||||||
|
en: shop
|
||||||
|
---
|
||||||
|
|
||||||
|
# Ranks
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
| | |
|
||||||
|
|:------------------------------------|:--------:|
|
||||||
|
| 1x Monthly crate Key | GIFT |
|
||||||
|
| Toggle night vision | PERK |
|
||||||
|
| `/enderchest` access | PERK |
|
||||||
|
| 4 additional homes | PERK |
|
||||||
|
| 4 additional auction house listings | PERK |
|
||||||
|
| extra particle slot | COSMETIC |
|
||||||
|
|
||||||
|
<button>Buy now for 5€</button>\
|
||||||
|
\
|
||||||
|
\
|
||||||
|

|
||||||
|
|
||||||
|
| | |
|
||||||
|
|:------------------------------------|:--------:|
|
||||||
|
| 3x Monthly crate Key | GIFT |
|
||||||
|
| Toggle night vision | PERK |
|
||||||
|
| `/enderchest` access | PERK |
|
||||||
|
| 6 additional homes | PERK |
|
||||||
|
| 6 additional auction house listings | PERK |
|
||||||
|
| 2 extra particle slot | COSMETIC |
|
||||||
|
| 5 Minion Slots | PERK |
|
||||||
|
| reduced Premium shop access | PERK |
|
||||||
|
| Fireball cannon | PERK |
|
||||||
|
| 1x monthly airstrike | PERk |
|
||||||
|
| use chat color codes | COSMETIC |
|
||||||
|
| `/back` access | PERK |
|
||||||
|
| 1 invincible chunk | PERK |
|
||||||
|
|
||||||
|
<button>Buy now for 14,25€</button>\
|
||||||
|
\
|
||||||
|
\
|
||||||
|

|
||||||
|
|
||||||
|
| | |
|
||||||
|
|:-------------------------------------|:--------:|
|
||||||
|
| 6x Monthly crate Key | GIFT |
|
||||||
|
| Toggle night vision | PERK |
|
||||||
|
| `/enderchest` access | PERK |
|
||||||
|
| 10 additional homes | PERK |
|
||||||
|
| 10 additional auction house listings | PERK |
|
||||||
|
| 5 extra particle slot | COSMETIC |
|
||||||
|
| 10 Minion Slots | PERK |
|
||||||
|
| Premium shop access | PERK |
|
||||||
|
| Fireball cannon | PERK |
|
||||||
|
| 3x monthly airstrike | PERk |
|
||||||
|
| use chat color codes | COSMETIC |
|
||||||
|
| `/back` access | PERK |
|
||||||
|
| spectate other players | PERK |
|
||||||
|
| +27 secure clan vault slots | PERK |
|
||||||
|
| 1x monthly 3 days raid protection | PERK |
|
||||||
|
| 1 cannon moving create | GIFT |
|
||||||
|
| 10% more Steamies per € | PERK |
|
||||||
|
| 2 invincible chunk | PERK |
|
||||||
|
| 1x Monthly invincible chunk buster | GIFT |
|
||||||
|
| `/nick` access | PERK |
|
||||||
|
|
||||||
|
<button>Buy now for 27€</button>
|
||||||
|
|
||||||
|
# Keys
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
| 70% | 20% | 10% |
|
||||||
|
|--------------------|---------------------------|----------------------|
|
||||||
|
| Scraps Kit | Creeper Bomb | Charged Creeper Bomb |
|
||||||
|
| Animal Crate | 3x Wither Skull | Airstrike |
|
||||||
|
| Trench Axe | Totem of Dying | Crate 2 Key |
|
||||||
|
| Trench Pickaxe | Legendary Trench Axe | Wither EMP |
|
||||||
|
| Trench Shovel | Legendary Trench Pikaxe | Random Max Enchant |
|
||||||
|
| Sell Wand | Legendary Trench Shovel | Legendary Multitool |
|
||||||
|
| 2x Portal | Minion | colorcode Nametag |
|
||||||
|
| Starter Weapon Kit | Legendary Helmet | Guardian Spawner |
|
||||||
|
| 1x God Apple | Legendary Chestplate | Legendary Raid Key |
|
||||||
|
| Shulker Box | Legendary Leggings | |
|
||||||
|
| Random Enchant | Legendary Boots | |
|
||||||
|
| Common Raid Key | 6x God Apples | |
|
||||||
|
| Starter Tool Kit | 3x Throwable Creeper | |
|
||||||
|
| 10 Steamies | Zombie Spawner | |
|
||||||
|
| Endstone Crate | Witch Spawner | |
|
||||||
|
| | Supercharged Auto Crafter | |
|
||||||
|
| | Scroll of Durability | |
|
||||||
|
| | 16x Reinforced Obsidian | |
|
||||||
|
| | Zombie Villager Spawner | |
|
||||||
|
| | Scroll of Binding | |
|
||||||
|
| | Rare Raid Key | |
|
||||||
|
|
||||||
|
<button>Buy now for 230s</button>\
|
||||||
|
\
|
||||||
|
\
|
||||||
|

|
||||||
|
|
||||||
|
| 20% | 40% | 30% | 10% |
|
||||||
|
|--------------------|---------------------------|----------------------|-------------------------|
|
||||||
|
| Scraps Kit | Creeper Bomb | Charged Creeper Bomb | Cannon Moving Crate |
|
||||||
|
| Animal Crate | 3x Wither Skull | Airstrike | Invincible Chunk Buster |
|
||||||
|
| Trench Axe | Totem of Dying | Crate 2 Key | Mythic Kit |
|
||||||
|
| Trench Pickaxe | Legendary Trench Axe | Wither EMP | Mythic Raid Key |
|
||||||
|
| Trench Shovel | Legendary Trench Pikaxe | Random Max Enchant | Wither Skeleton Spawner |
|
||||||
|
| Sell Wand | Legendary Trench Shovel | Legendary Multitool | Blaze Spawner |
|
||||||
|
| 2x Portal | Minion | colorcode Nametag | Captain Rank |
|
||||||
|
| Starter Weapon Kit | Legendary Helmet | Guardian Spawner | |
|
||||||
|
| 1x God Apple | Legendary Chestplate | Legendary Raid Key | |
|
||||||
|
| Shulker Box | Legendary Leggings | | |
|
||||||
|
| Random Enchant | Legendary Boots | | |
|
||||||
|
| Common Raid Key | 6x God Apples | | |
|
||||||
|
| Starter Tool Kit | 3x Throwable Creeper | | |
|
||||||
|
| 10 Steamies | Zombie Spawner | | |
|
||||||
|
| Endstone Crate | Witch Spawner | | |
|
||||||
|
| | Supercharged Auto Crafter | | |
|
||||||
|
| | Scroll of Durability | | |
|
||||||
|
| | 16x Reinforced Obsidian | | |
|
||||||
|
| | Zombie Villager Spawner | | |
|
||||||
|
| | Scroll of Binding | | |
|
||||||
|
| | Rare Raid Key | | |
|
||||||
|
|
||||||
|
<button>Buy now for 230s</button>| Common Raid Key | 6x God Apples | |
|
||||||
|
| Starter Tool Kit | 3x Throwable Creeper | |
|
||||||
|
| 10 Steamies | Zombie Spawner | |
|
||||||
|
| Endstone Crate | Witch Spawner | |
|
||||||
|
| | Supercharged Auto Crafter | |
|
||||||
|
| | Scroll of Durability | |
|
||||||
|
| | 16x Reinforced Obsidian | |
|
||||||
|
| | Zombie Villager Spawner | |
|
||||||
|
| | Scroll of Binding | |
|
||||||
|
| | Rare Raid Key | |
|
||||||
|
|
||||||
|
<button>Buy now for 1173s</button>\
|
||||||
|
\
|
||||||
|
\
|
||||||
|

|
||||||
|
|
||||||
|
| 10% | 70% | 20% |
|
||||||
|
|---------------------------|----------------------|-------------------------|
|
||||||
|
| Creeper Bomb | Charged Creeper Bomb | Cannon Moving Crate |
|
||||||
|
| 3x Wither Skull | Airstrike | Invincible Chunk Buster |
|
||||||
|
| Totem of Dying | Crate 2 Key | Mythic Kit |
|
||||||
|
| Legendary Trench Axe | Wither EMP | Mythic Raid Key |
|
||||||
|
| Legendary Trench Pikaxe | Random Max Enchant | Wither Skeleton Spawner |
|
||||||
|
| Legendary Trench Shovel | Legendary Multitool | Blaze Spawner |
|
||||||
|
| Minion | colorcode Nametag | Captain Rank |
|
||||||
|
| Legendary Helmet | Guardian Spawner | |
|
||||||
|
| Legendary Chestplate | Legendary Raid Key | |
|
||||||
|
| Legendary Leggings | | |
|
||||||
|
| Legendary Boots | | |
|
||||||
|
| 6x God Apples | | |
|
||||||
|
| 3x Throwable Creeper | | |
|
||||||
|
| Zombie Spawner | | |
|
||||||
|
| Witch Spawner | | |
|
||||||
|
| Supercharged Auto Crafter | | |
|
||||||
|
| Scroll of Durability | | |
|
||||||
|
| 16x Reinforced Obsidian | | |
|
||||||
|
| Zombie Villager Spawner | | |
|
||||||
|
| Scroll of Binding | | |
|
||||||
|
| Rare Raid Key | | |
|
||||||
|
|
||||||
|
<button>Buy now for 5869s</button>
|
||||||
|
|
||||||
|
# Steamies
|
||||||
|
|
||||||
|
 420 Steamies für 4,50€\
|
||||||
|
\
|
||||||
|
 4269 Steamies für 45,00€\
|
||||||
|
\
|
||||||
|
 42690 Steamies für 450,00€
|
||||||
BIN
src/content/pages/de/steamiebag.png
Normal file
|
After Width: | Height: | Size: 943 B |
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "Graf Spree",
|
"name": "Graf Spee",
|
||||||
"description": "A simple, lightweight description of a frostbite.",
|
"description": "A simple, lightweight description of a frostbite.",
|
||||||
"id": 123,
|
"id": 123,
|
||||||
"creator": ["Test", "Test2"],
|
"creator": ["Test", "Test2"],
|
||||||
"gamemode": "warship",
|
"gamemode": "warship",
|
||||||
"image": "../../../images/publics/grafspree/area_render.png",
|
"image": "../../../images/publics/grafspee/area_render.png",
|
||||||
"3d": false
|
"3d": false
|
||||||
}
|
}
|
||||||
3
src/content/rules/de/missilewars.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
translationKey: mw
|
||||||
|
---
|
||||||
@@ -87,7 +87,10 @@
|
|||||||
"title": "Hilfe",
|
"title": "Hilfe",
|
||||||
"docs": "Dokumentation"
|
"docs": "Dokumentation"
|
||||||
},
|
},
|
||||||
"account": "Konto"
|
"account": "Konto",
|
||||||
|
"ranked": {
|
||||||
|
"mw": "MissileWars"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wg": {
|
"wg": {
|
||||||
@@ -123,6 +126,9 @@
|
|||||||
"microwg": {
|
"microwg": {
|
||||||
"title": "MicroWarGear"
|
"title": "MicroWarGear"
|
||||||
},
|
},
|
||||||
|
"mw": {
|
||||||
|
"title": "MissileWars"
|
||||||
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"imprint": "Impressum",
|
"imprint": "Impressum",
|
||||||
"privacy": "Datenschutzerklärung",
|
"privacy": "Datenschutzerklärung",
|
||||||
@@ -205,7 +211,8 @@
|
|||||||
},
|
},
|
||||||
"label": {
|
"label": {
|
||||||
"username": "Nutzername",
|
"username": "Nutzername",
|
||||||
"password": "Passwort"
|
"password": "Passwort",
|
||||||
|
"repeat": "Passwort Wiederholen"
|
||||||
},
|
},
|
||||||
"setPassword": "Wie setzte ich mein Passwort?",
|
"setPassword": "Wie setzte ich mein Passwort?",
|
||||||
"submit": "Login",
|
"submit": "Login",
|
||||||
|
|||||||
@@ -149,7 +149,8 @@
|
|||||||
},
|
},
|
||||||
"label": {
|
"label": {
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
"password": "Password"
|
"password": "Password",
|
||||||
|
"repeat": "Repeat Password"
|
||||||
},
|
},
|
||||||
"setPassword": "How to set a Password",
|
"setPassword": "How to set a Password",
|
||||||
"submit": "Login",
|
"submit": "Login",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
@@ -3,7 +3,7 @@ import {Image} from "astro:assets";
|
|||||||
import Basic from "./Basic.astro";
|
import Basic from "./Basic.astro";
|
||||||
import "../styles/button.css";
|
import "../styles/button.css";
|
||||||
import localLogo from "../images/logo.png";
|
import localLogo from "../images/logo.png";
|
||||||
import {YoutubeSolid, DiscordSolid} from "flowbite-svelte-icons";
|
import {YoutubeSolid, DiscordSolid, FileCodeSolid} from "flowbite-svelte-icons";
|
||||||
import {t} from "astro-i18n";
|
import {t} from "astro-i18n";
|
||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
|
|
||||||
@@ -50,6 +50,9 @@ const {title, description} = Astro.props;
|
|||||||
<a class="flex" href="/discord">
|
<a class="flex" href="/discord">
|
||||||
<DiscordSolid class="mr-2"/>
|
<DiscordSolid class="mr-2"/>
|
||||||
Discord</a>
|
Discord</a>
|
||||||
|
<a class="flex" href="https://git.steamwar.de">
|
||||||
|
<FileCodeSolid class="mr-2"/>
|
||||||
|
Gitea</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="text-sm text-white text-center mt-1">© SteamWar.de - Made with ❤️ by Chaoscaot</span>
|
<span class="text-sm text-white text-center mt-1">© SteamWar.de - Made with ❤️ by Chaoscaot</span>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const ogImage = await getImage({
|
|||||||
)}
|
)}
|
||||||
<div class={post.data.image ? "absolute bottom-8 left-2" : "mb-4"}>
|
<div class={post.data.image ? "absolute bottom-8 left-2" : "mb-4"}>
|
||||||
<h1 class="text-4xl mb-0" transition:name={post.data.title + "-title"}>{post.data.title}</h1>
|
<h1 class="text-4xl mb-0" transition:name={post.data.title + "-title"}>{post.data.title}</h1>
|
||||||
<div class="flex items-center mt-2 text-neutral-300">
|
<div class="flex items-center mt-2 text-neutral-800 dark:text-neutral-300">
|
||||||
<TagSolid class="w-4 h-4 mr-2"/>
|
<TagSolid class="w-4 h-4 mr-2"/>
|
||||||
<div transition:name={post.data.title + "-tags"}>
|
<div transition:name={post.data.title + "-tags"}>
|
||||||
{post.data.tags.map(tag => (
|
{post.data.tags.map(tag => (
|
||||||
@@ -111,15 +111,13 @@ const ogImage = await getImage({
|
|||||||
import type {ExtendedEvent} from "@type/event";
|
import type {ExtendedEvent} from "@type/event";
|
||||||
import {mount} from "svelte";
|
import {mount} from "svelte";
|
||||||
|
|
||||||
const eventMounts: Map<string, ((ev: ExtendedEvent) => void)[]> = new Map();
|
const eventMounts: Map<string, Promise<ExtendedEvent>> = new Map();
|
||||||
|
|
||||||
class FightTableElement extends HTMLElement {
|
class FightTableElement extends HTMLElement {
|
||||||
connectedCallback(): void {
|
connectedCallback(): void {
|
||||||
if (!eventMounts.has(this.dataset["event"]!)) {
|
loadEvent(this.dataset["event"]!);
|
||||||
eventMounts.set(this.dataset["event"]!, []);
|
|
||||||
}
|
|
||||||
const rows = Number.parseInt(this.dataset["rows"]!);
|
const rows = Number.parseInt(this.dataset["rows"]!);
|
||||||
eventMounts.get(this.dataset["event"]!)!.push(ev => {
|
eventMounts.get(this.dataset["event"]!)!.then(ev => {
|
||||||
mount(FightTable, {
|
mount(FightTable, {
|
||||||
target: this,
|
target: this,
|
||||||
props: {
|
props: {
|
||||||
@@ -134,11 +132,9 @@ const ogImage = await getImage({
|
|||||||
|
|
||||||
class GroupTableElement extends HTMLElement {
|
class GroupTableElement extends HTMLElement {
|
||||||
connectedCallback(): void {
|
connectedCallback(): void {
|
||||||
if (!eventMounts.has(this.dataset["event"]!)) {
|
loadEvent(this.dataset["event"]!);
|
||||||
eventMounts.set(this.dataset["event"]!, []);
|
|
||||||
}
|
|
||||||
const rows = Number.parseInt(this.dataset["rows"]!);
|
const rows = Number.parseInt(this.dataset["rows"]!);
|
||||||
eventMounts.get(this.dataset["event"]!)!.push(ev => {
|
eventMounts.get(this.dataset["event"]!)!.then(ev => {
|
||||||
mount(GroupTable, {
|
mount(GroupTable, {
|
||||||
target: this,
|
target: this,
|
||||||
props: {
|
props: {
|
||||||
@@ -154,17 +150,13 @@ const ogImage = await getImage({
|
|||||||
customElements.define("fight-table", FightTableElement);
|
customElements.define("fight-table", FightTableElement);
|
||||||
customElements.define("group-table", GroupTableElement);
|
customElements.define("group-table", GroupTableElement);
|
||||||
|
|
||||||
function mountEvent() {
|
function loadEvent(id: string) {
|
||||||
for (const key of eventMounts.keys()) {
|
if (!eventMounts.has(id)) {
|
||||||
get(eventRepo).getEvent(key).then(ev => {
|
eventMounts.set(id, get(eventRepo).getEvent(id));
|
||||||
for (const mount of eventMounts.get(key)!) {
|
|
||||||
mount(ev);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mountEvent();
|
document.addEventListener("astro:before-swap", eventMounts.clear);
|
||||||
</script>
|
</script>
|
||||||
</article>
|
</article>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ import {t} from "astro-i18n";
|
|||||||
<script>
|
<script>
|
||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
import {navigate} from "astro:transitions/client";
|
import {navigate} from "astro:transitions/client";
|
||||||
|
import {get} from "svelte/store";
|
||||||
|
import {loggedIn} from "../components/repo/authv2";
|
||||||
document.addEventListener("astro:page-load", () => {
|
document.addEventListener("astro:page-load", () => {
|
||||||
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
|
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
|
||||||
if ((localStorage.getItem("sw-session") ?? "") === "") {
|
if (!get(loggedIn)) {
|
||||||
navigate(l("/login"), {});
|
navigate(l("/login"), {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ import BackgroundImage from "../components/BackgroundImage.astro";
|
|||||||
<script>
|
<script>
|
||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
import {navigate} from "astro:transitions/client";
|
import {navigate} from "astro:transitions/client";
|
||||||
|
import {loggedIn} from "../components/repo/authv2";
|
||||||
|
import {get} from "svelte/store";
|
||||||
|
|
||||||
document.addEventListener("astro:page-load", () => {
|
document.addEventListener("astro:page-load", () => {
|
||||||
if (window.location.href.endsWith("/login") || window.location.href.endsWith("/login/")) {
|
if (window.location.href.endsWith("/login") || window.location.href.endsWith("/login/")) {
|
||||||
if ((localStorage.getItem("sw-session") ?? "") !== "") {
|
if (get(loggedIn)) {
|
||||||
navigate(l("/dashboard"), {history: "replace"});
|
navigate(l("/dashboard"), {history: "replace"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,5 @@ const modes = await getCollection("modes", entry => entry.data.main);
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>))}
|
</div>))}
|
||||||
|
<a href={l("/rangliste/MissileWars")}>MissileWars Rangliste</a>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
@@ -31,7 +31,7 @@ table {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
tr:nth-child(odd) {
|
tr:nth-child(odd) {
|
||||||
@apply bg-neutral-800;
|
@apply bg-neutral-200 dark:bg-neutral-800;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||