//const game is the game instance!!
for (let roomId in game.rooms) {
const room = game.rooms[roomId];
// Room-specific code here
// Client iteration
for (let clientId in room.clients) {
const client = room.clients[clientId];
// Client-specific code here
//
for (let entityId in client.entities) {
try {
var EP = JSON.parse(client.entities[entityId])
// Entities-specific code here
} catch (e) {
console.log(e)
}
}
//Persistent Object iteration
for (let persistentObjectId in room.persistentObjects) {
const persistentObject = room.persistentObjects[persistentObjectId]
//Persistent Objects specific code here
}
}
}