forked from noxious/client
New login design, added basic logic for multiplayer (WIP)
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
import { io, Socket } from 'socket.io-client'
|
||||
import config from '@/config';
|
||||
|
||||
class SocketioService {
|
||||
socket: Socket | undefined;
|
||||
constructor() {}
|
||||
|
||||
setupSocketConnection(): void {
|
||||
this.socket = io(config.server_endpoint as string);
|
||||
}
|
||||
|
||||
disconnect(): void {
|
||||
if (this.socket) {
|
||||
this.socket.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
registerAccount(account: string): void {
|
||||
if (this.socket) {
|
||||
this.socket.emit('register', account);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new SocketioService();
|
Reference in New Issue
Block a user