Solve serialization

This commit is contained in:
schmelczerandras 2020-10-06 21:33:04 +02:00
parent ba8b1a29fd
commit 8e44dd3733
45 changed files with 242 additions and 201 deletions

View file

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