Add basic multiplayer

This commit is contained in:
schmelczerandras 2020-10-05 19:07:17 +02:00
parent 0f0a1eaf67
commit 46a48e7c15
113 changed files with 1362 additions and 754 deletions

View file

@ -0,0 +1,11 @@
import { Command, CommandReceiver, TransportEvents } from 'shared';
export class CommandReceiverSocket extends CommandReceiver {
constructor(private readonly socket: SocketIOClient.Socket) {
super();
}
protected defaultCommandExecutor(command: Command) {
this.socket.emit(TransportEvents.PlayerToServer, JSON.stringify(command));
}
}