Well, let me explain it a bit more...
The thing is, roomObj is undefined and when I do roomObj.getUserList() it's still undefined! I don't understand what's wrong!
trace(roomObj.getUserList()) becomes undefined.
edit:
I don't if this has anything to do with this...
Code: Select all
if (evt.name == "userLost")
{
var uid = evt.userId
var roomIds = evt.roomIds
var gameRooms = _server.getCurrentZone().getRooms()
var rId = roomIds[0]
var gameRoom = gameRooms[rId]
trace(gameRoom + " " + gameRooms + " " + rId)
var lostUser = gameRoom.getAllUsers()[uid]
delete gameRoom.userList[uid]
delete userList[nick]
}
The trace comes out with:
[tobattles.as]: undefined [Ljava.lang.Object;@120d62b 2
18:27:51.515 - [ WARNING ] > Error in extension [ tobattles.as ]: TypeError: Cannot call method "getAllUsers" of undefined (tobattles.as#1191) Line: 202
What confused me was "[Ljava.lang.Object;@120d62b". I keep seeing that when I'm using the server to trace rooms or using the server to send a user list to the client.
I don't understand what's wrong because I used to use SFS in the summer. I try again now and it's not working...