Implement on enter/leave layer events
This commit is contained in:
parent
0b08d9251e
commit
934e24f837
14 changed files with 222 additions and 18 deletions
|
@ -231,12 +231,12 @@ export class SocketManager implements ZoneEventListener {
|
|||
try {
|
||||
client.viewport = viewport;
|
||||
|
||||
const world = this.rooms.get(client.roomId);
|
||||
if (!world) {
|
||||
const room = this.rooms.get(client.roomId);
|
||||
if (!room) {
|
||||
console.error("In SET_VIEWPORT, could not find world with id '", client.roomId, "'");
|
||||
return;
|
||||
}
|
||||
world.setViewport(client, client.viewport);
|
||||
room.setViewport(client, client.viewport);
|
||||
} catch (e) {
|
||||
console.error('An error occurred on "SET_VIEWPORT" event');
|
||||
console.error(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue