Fix error mapping refresh in back & the end of this feature development
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
{
|
||||
"name":"exitSceneUrl",
|
||||
"type":"string",
|
||||
"value":"\/map\/files\/Floor1\/floor1.json"
|
||||
"value":"\/Floor1\/floor1.json"
|
||||
}],
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
{
|
||||
"name":"exitSceneUrl",
|
||||
"type":"string",
|
||||
"value":"\/map\/files\/Floor0\/floor0.json"
|
||||
"value":"\/Floor0\/floor0.json"
|
||||
}],
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
|
||||
@@ -305,7 +305,7 @@ export class IoSocketController {
|
||||
if (!rooms.refreshUserPosition) {
|
||||
rooms.refreshUserPosition = RefreshUserPositionFunction;
|
||||
}
|
||||
rooms.refreshUserPosition(rooms, this.Io);
|
||||
rooms.refreshUserPosition(rooms, this.Io, this.Worlds);
|
||||
}
|
||||
|
||||
//Hydrate and manage error
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const SECRET_KEY = process.env.SECRET_KEY || "THECODINGMACHINE_SECRET_KEY";
|
||||
const URL_ROOM_STARTED = "/map/files/Floor0/floor0.json";
|
||||
const URL_ROOM_STARTED = "/Floor0/floor0.json";
|
||||
const MINIMUM_DISTANCE = process.env.MINIMUM_DISTANCE ? Number(process.env.MINIMUM_DISTANCE) : 64;
|
||||
const GROUP_RADIUS = process.env.GROUP_RADIUS ? Number(process.env.GROUP_RADIUS) : 48;
|
||||
|
||||
|
||||
@@ -40,12 +40,16 @@ let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server
|
||||
mapPositionUserByRoom.set(data.roomId, dataArray);
|
||||
|
||||
// update position in the worl
|
||||
if (!Worlds) {
|
||||
return;
|
||||
}
|
||||
let messageUserPosition = new MessageUserPosition(data);
|
||||
let world = Worlds.get(messageUserPosition.roomId);
|
||||
if(world) {
|
||||
world.updatePosition(messageUserPosition);
|
||||
Worlds.set(messageUserPosition.roomId, world);
|
||||
if (!world) {
|
||||
return;
|
||||
}
|
||||
world.updatePosition(messageUserPosition);
|
||||
Worlds.set(messageUserPosition.roomId, world);
|
||||
}
|
||||
rooms.userPositionMapByRoom = Array.from(mapPositionUserByRoom);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user