Hello,
This is my room variables;
r.getVariables().toString() : vars:[[RVar: created_date, type: 4, value: 2015-01-29 09:25:54, isPriv: false], [RVar: playera, type: 4, value: xxx, isPriv: false], [RVar: playerb, type: 4, value: , isPriv: false], [RVar: botgame, type: 1, value: true, isPriv: false], [RVar: gamestatus, type: 2, value: 0, isPriv: false]]
But when i try to run this , i'm getting false, but botgame variable is exist.
r.getVariables().contains("botgame") : false
What did I wrong can you help me please?
Best Regards
getroomVariables contains error
Re: getroomVariables contains error
Hi,
there's a problem with your code.
room.getVariables() returns a List<RoomVariable>
If you call contains("something") on that list you're searching for the String "something" inside a List that doesn't even contain strings (it contains RoomVariable types)
What you probably wanted to do is this:
which will return true, if a RoomVar with that name exists.
Cheers
there's a problem with your code.
room.getVariables() returns a List<RoomVariable>
If you call contains("something") on that list you're searching for the String "something" inside a List that doesn't even contain strings (it contains RoomVariable types)
What you probably wanted to do is this:
Code: Select all
room.containsVariable("varName");
which will return true, if a RoomVar with that name exists.
Cheers
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 24 guests