I have room extensions set and was trying to create the room var on init() like this...
Code: Select all
@Override
public void init() {
trace("ext running.");
User u = null;
Room room = getParentRoom();
ArrayList<RoomVariable> roomVars = new ArrayList<RoomVariable>();
roomVars.add(new SFSRoomVariable("canvas", ""));
SmartFoxServer.getInstance().getAPIManager().getSFSApi().setRoomVariables(u, room, roomVars);
//adding draw class
this.addRequestHandler("draw", DrawHandler.class);
}
What is this the best way to do this?
I'm getting errors in the console with the above code.