11 for fast login
This commit is contained in:
parent
110fd4e608
commit
8f26a40a0e
@ -4,7 +4,10 @@
|
|||||||
import { CharacterHairStorage, CharacterTypeStorage, MapObjectStorage, MapStorage, SoundStorage, SpriteStorage, TileStorage } from '@/storage/storages'
|
import { CharacterHairStorage, CharacterTypeStorage, MapObjectStorage, MapStorage, SoundStorage, SpriteStorage, TileStorage } from '@/storage/storages'
|
||||||
import { TextureStorage } from '@/storage/textureStorage'
|
import { TextureStorage } from '@/storage/textureStorage'
|
||||||
import { onMounted, onUnmounted } from 'vue'
|
import { onMounted, onUnmounted } from 'vue'
|
||||||
|
import {login} from "@/services/authenticationService";
|
||||||
|
import {useGameStore} from "@/stores/gameStore";
|
||||||
|
|
||||||
|
const gameStore = useGameStore()
|
||||||
const mapStorage = new MapStorage()
|
const mapStorage = new MapStorage()
|
||||||
const tileStorage = new TileStorage()
|
const tileStorage = new TileStorage()
|
||||||
const mapObjectStorage = new MapObjectStorage()
|
const mapObjectStorage = new MapObjectStorage()
|
||||||
@ -37,6 +40,16 @@ async function handleKeyPress(event: KeyboardEvent) {
|
|||||||
currentString = '' // Reset
|
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
|
// Reset string after a certain amount of time
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
currentString = ''
|
currentString = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user