diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte
index 3396572..f52486c 100644
--- a/front/volume/src/App.svelte
+++ b/front/volume/src/App.svelte
@@ -14,8 +14,8 @@
import type { ChannelsType } from "./components/Channels.svelte";
import Leaderboard from "./components/Leaderboard.svelte";
import type { Player } from "./components/Leaderboard.svelte";
-
import { store, getUser, login, logout, API_URL } from "./Auth";
+ import FakeLogin from "./FakeLogin.svelte";
// PROFILE
@@ -145,6 +145,20 @@
isLeaderboardOpen = true;
leaderboard = await getLeader();
}
+
+ let usernameFake = "test";
+ let ftIdFake = "42";
+ let fakemenu = true;
+ let fakeUser = false;
+ function impersonate() {
+ const user = {
+ username: "test",
+ socketKey: "42",
+ };
+ store.set(user)
+ fakeUser = true
+ fakemenu = false
+ }
@@ -236,7 +250,14 @@
{/if}
-
+
+ {#if fakemenu}
+
+
+
+ {:else}
+
+ {/if}
{/if}
diff --git a/front/volume/src/FakeLogin.svelte b/front/volume/src/FakeLogin.svelte
new file mode 100644
index 0000000..12fc985
--- /dev/null
+++ b/front/volume/src/FakeLogin.svelte
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
Result: {result}
+
+
\ No newline at end of file
diff --git a/front/volume/src/components/Pong/GameCreation.svelte b/front/volume/src/components/Pong/GameCreation.svelte
index ac042f4..4f970d6 100644
--- a/front/volume/src/components/Pong/GameCreation.svelte
+++ b/front/volume/src/components/Pong/GameCreation.svelte
@@ -4,8 +4,8 @@
import { DEFAULT_MAP_SIZE, GAME_EVENTS } from "./constants";
import MapCustomization from "./MapCustomization.svelte";
import type { GameCreationDto } from "./dtos/GameCreationDto";
+ import { store } from "../../Auth";
- export let username: string;
export let socket: WebSocket;
let map: Map = new Map(DEFAULT_MAP_SIZE.clone(), []);
@@ -13,7 +13,7 @@
function createGame() {
const data: GameCreationDto = {
- playerNames: [username, otherUsername],
+ playerNames: [$store.username, otherUsername],
map,
};
socket.send(formatWebsocketData(GAME_EVENTS.CREATE_GAME, data));
diff --git a/front/volume/src/components/Pong/Pong.svelte b/front/volume/src/components/Pong/Pong.svelte
index 2a76ee2..fdc744c 100644
--- a/front/volume/src/components/Pong/Pong.svelte
+++ b/front/volume/src/components/Pong/Pong.svelte
@@ -11,6 +11,8 @@
import { getUser, store } from "../../Auth";
import ColorPicker from "./ColorPicker.svelte";
+ export let fakeUser;
+
const SERVER_URL = `ws://${import.meta.env.VITE_HOST}:${
import.meta.env.VITE_BACK_PORT
}`;
@@ -166,7 +168,6 @@
-
{:else if createMatchWindow}
(createMatchWindow = false)}