Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Custom fields for rooms, just like for users?

Avatar

Level 3

Hello,

I notice for users we can set custom fields via UserManager, but not for rooms with RoomManager. ( I checked RoomManager as well as RoomSettings ).

I would like to add a custom field so I can set whether the game has started in the room or not, and if it has, I wont send any users there.

Can we extend room state with custom values perhaps?

PS: It would also be nice to be able to retreive a room that has this custom property

Message was edited by: Mickey79

1 Accepted Solution

Avatar

Correct answer by
Employee

Any reason you can't just create your own "state" CollectionNode / node ?

Users have custom fields because it makes it easier to share custom properties associated to all users connected to a room (so every user in a room can potentially see these extra properties).

For a room I don't see how making this feature available in RoomManager is more effective managing a separate collection node / node (apart that you have to create the new node in advance, but you can easily solve that with a room template.

Also, what do you mean by "It would also be nice to be able to retreive a room that has this custom property". Are you thinking of some sort of query on all rooms in your account for the ones that have this property (or this property set to true ?). This is not possible since the room persisted state is stored as a blob that we don't introspect.

But you can use the server API to retrieve that property value for a particular room. For more than that you should keep this kind of information in a "database" you mantain.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Any reason you can't just create your own "state" CollectionNode / node ?

Users have custom fields because it makes it easier to share custom properties associated to all users connected to a room (so every user in a room can potentially see these extra properties).

For a room I don't see how making this feature available in RoomManager is more effective managing a separate collection node / node (apart that you have to create the new node in advance, but you can easily solve that with a room template.

Also, what do you mean by "It would also be nice to be able to retreive a room that has this custom property". Are you thinking of some sort of query on all rooms in your account for the ones that have this property (or this property set to true ?). This is not possible since the room persisted state is stored as a blob that we don't introspect.

But you can use the server API to retrieve that property value for a particular room. For more than that you should keep this kind of information in a "database" you mantain.

Avatar

Level 3

Wow, Dear Raff this answer is much much appreciated..

I am still digesting it, and will certainly help me achieve my goal. I will post back if I have anything meaningful to ask or add.