Browse Source

Adds timestamp to moves

Nikatlas 6 years ago
parent
commit
019ddd0da3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      services/matchmaking/randomFree.js

+ 1 - 0
services/matchmaking/randomFree.js

@@ -56,6 +56,7 @@ class randomFree {
                     p2.emit('joinGame', matchInfo.playerTwoState);
                     p2.emit('joinGame', matchInfo.playerTwoState);
 
 
                     const broadcast = (data) => {
                     const broadcast = (data) => {
+                    	data.timestamp = new Date().getTime();
                     	nsp.in(channel).emit('move', data);	
                     	nsp.in(channel).emit('move', data);	
                     };
                     };
                     p1.on('broadcast', broadcast);
                     p1.on('broadcast', broadcast);