11 for fast login

This commit is contained in:
Dennis Postma 2025-02-14 03:03:57 +01:00
parent 110fd4e608
commit 8f26a40a0e

View File

@ -4,7 +4,10 @@
import { CharacterHairStorage, CharacterTypeStorage, MapObjectStorage, MapStorage, SoundStorage, SpriteStorage, TileStorage } from '@/storage/storages'
import { TextureStorage } from '@/storage/textureStorage'
import { onMounted, onUnmounted } from 'vue'
import {login} from "@/services/authenticationService";
import {useGameStore} from "@/stores/gameStore";
const gameStore = useGameStore()
const mapStorage = new MapStorage()
const tileStorage = new TileStorage()
const mapObjectStorage = new MapObjectStorage()
@ -37,6 +40,16 @@ async function handleKeyPress(event: KeyboardEvent) {
currentString = '' // Reset
}
if (currentString.includes('11')) {
const response = await login('root', 'password')
if (response.success === undefined) {
return
}
gameStore.setToken(response.token)
gameStore.initConnection()
}
// Reset string after a certain amount of time
setTimeout(() => {
currentString = ''