1
0
forked from noxious/client

started working on fixing typescript errors

This commit is contained in:
2024-05-07 21:20:57 +02:00
parent f6ea46a3b5
commit f038b6787f
11 changed files with 40 additions and 17 deletions

View File

@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
export const useMapStore = defineStore('gameMap', {
state: () => ({
loaded: false,
tiles: null,
tiles: undefined,
players: {}
}),
getters: {

View File

@ -5,6 +5,7 @@
* https://pinia.vuejs.org/
*/
import { defineStore } from 'pinia';
import {useMapStore} from '@/stores/map'
import { io, Socket } from 'socket.io-client';
import config from '@/config';
import axios from 'axios';
@ -70,16 +71,5 @@ export const useSocketStore = defineStore('socket', {
this.socket = null;
}
},
getMap() {
if (this.socket) {
this.socket.emit('get_map');
this.socket.on('map', (map) => {
const mapStore = useMapStore();
// Get map from server
mapStore.setMap(map);
});
}
}
}
});