c++ client custom room properties
Options
Hi,
I am probably doing something wrong, because i can not set the custom room properties. The code is as follows - any help would be appreciated:
This is done by master client.
Does it need time to sync?
I am probably doing something wrong, because i can not set the custom room properties. The code is as follows - any help would be appreciated:
MutableRoom room = _client->getCurrentlyJoinedRoom(); //No custom room properties set room.addCustomProperty(<char *>, <hashTable>) //Adding some variables of types given room.getCustomProperties.toString() //Logging this to console prints correct values which have just been added eg. { <char *> = <hashtable> } _client->getCurrentlyJoinedRoom().getCustomProperties().toString() //Loging that immediately after gives empty hash table with no values inside { }
This is done by master client.
Does it need time to sync?
0
Comments
-
Hi Marius.
[code2=cpp]MutableRoom room = _client->getCurrentlyJoinedRoom(); //No custom room properties set[/code2]
This line makes a copy of the room. Afterwards you are operating on that copy, so you are never actually modifying the original room.0 -
Ups! Did not notice that - silly mistake. Found method which i probably have to use:
bool Client::opSetPropertiesOfRoom(const Hashtable& properties)
So do i get properties from local room copy, and set them invoking this method?0 -
[code2=cpp]bool Client::opSetPropertiesOfRoom(const Hashtable& properties)[/code2]
is protected.
Just get a reference to the currently joined room instead of a copy and then operate on that reference:
[code2=cpp]MutableRoom& room = _client->getCurrentlyJoinedRoom(); //No custom room properties set[/code2]0