add basic updating to client on physics
This commit is contained in:
parent
95e0f6b710
commit
1027d980c1
15 changed files with 160 additions and 13 deletions
|
@ -36,6 +36,14 @@ class Connection {
|
|||
});
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.player.disconnect();
|
||||
}
|
||||
|
||||
send(msg, data) {
|
||||
this.io.to(this.socket.id).emit(msg, data);
|
||||
}
|
||||
|
||||
tick() {
|
||||
this.chatCooldown -= 1;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ class GameNet {
|
|||
cons.set(id, new Connection(this, socket));
|
||||
|
||||
socket.on('disconnect', _ => {
|
||||
cons.get(id).disconnect();
|
||||
cons.delete(id);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue