How to remove the room variable?
Posted: 08 Feb 2012, 04:59
Hi all!
I want to ask exactly how to remove the roomvariables?
When new player joining the room, the server create roomvariable named "player1", "player2", etc.
[code]
List<RoomVariable> roomVars = new ArrayList<RoomVariable>();
if (room.getVariable("player1") == null) {
roomVars.add(new SFSRoomVariable("player1", sender.getName(), false, false, true));
}
[/code]
When one of the player exiting the room, I remove the roomvariable with this code:
[code]
Room room = (Room) event.getParameter(SFSEventParam.ROOM);
if (room.getVariable("player1") != null && room.getVariable("player1").getStringValue().equals(sender.getName())) {
room.removeVariable("player1");
}
[/code]
When I check the localhost sfsadmin, it is true that the variable is removed, but when I test the flash movie, the roomvariable is still there!
Any thoughts? Thanks.
I want to ask exactly how to remove the roomvariables?
When new player joining the room, the server create roomvariable named "player1", "player2", etc.
[code]
List<RoomVariable> roomVars = new ArrayList<RoomVariable>();
if (room.getVariable("player1") == null) {
roomVars.add(new SFSRoomVariable("player1", sender.getName(), false, false, true));
}
[/code]
When one of the player exiting the room, I remove the roomvariable with this code:
[code]
Room room = (Room) event.getParameter(SFSEventParam.ROOM);
if (room.getVariable("player1") != null && room.getVariable("player1").getStringValue().equals(sender.getName())) {
room.removeVariable("player1");
}
[/code]
When I check the localhost sfsadmin, it is true that the variable is removed, but when I test the flash movie, the roomvariable is still there!
Any thoughts? Thanks.