Add proper data to the user join emit
This commit is contained in:
parent
51db315e35
commit
4a9d5cb533
1 changed files with 4 additions and 1 deletions
|
|
@ -60,7 +60,10 @@ export default (io: Server, socket: Socket, data: JoinGame) => {
|
||||||
let player = new Player(data.name, socket);
|
let player = new Player(data.name, socket);
|
||||||
game.players.push(player);
|
game.players.push(player);
|
||||||
|
|
||||||
socket.emit(`GameJoined`, {});
|
socket.emit(`GameJoined`, {
|
||||||
|
status: 200,
|
||||||
|
players: game.playerData,
|
||||||
|
});
|
||||||
socket.to(game.id).emit(`PlayerUpdate`, {
|
socket.to(game.id).emit(`PlayerUpdate`, {
|
||||||
status: 200,
|
status: 200,
|
||||||
action: "new",
|
action: "new",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue