-
Notifications
You must be signed in to change notification settings - Fork 0
realtime_room_properties
Room custom properties are shared key/value data attached to the current room and synced to all players. Any player can set them (subject to the room's rules), read them, and use compare-and-swap for safe concurrent updates. Changes are delivered to photon_realtime_set_callback_room_properties_change.
Set or remove room custom properties:
- photon_realtime_room_properties_set_string
- photon_realtime_room_properties_set_i32
- photon_realtime_room_properties_set_f64
- photon_realtime_room_properties_set_bool
- photon_realtime_room_properties_remove
- photon_realtime_room_properties_clear
Read room custom properties:
- photon_realtime_room_properties_has
- photon_realtime_room_properties_get_string
- photon_realtime_room_properties_get_i32
- photon_realtime_room_properties_get_f64
- photon_realtime_room_properties_get_bool
- photon_realtime_room_properties_to_string
- photon_realtime_room_properties_get_all
Atomically update a property only if it still holds an expected value:
- photon_realtime_room_properties_cas_string
- photon_realtime_room_properties_cas_i32
- photon_realtime_room_properties_cas_f64
- photon_realtime_room_properties_cas_bool
Sets a string custom property on the current room and syncs it to everyone. Other clients are notified via photon_realtime_set_callback_room_properties_change.
Syntax:
photon_realtime_room_properties_set_string(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | String | The string value to set. |
Returns:
Whether the property was set.
Sets a 32-bit integer custom property on the current room and syncs it to everyone.
Syntax:
photon_realtime_room_properties_set_i32(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | Real | The integer value to set. |
Returns:
Whether the property was set.
Sets a 64-bit floating point custom property on the current room and syncs it to everyone.
Syntax:
photon_realtime_room_properties_set_f64(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | Real | The value to set. |
Returns:
Whether the property was set.
Sets a boolean custom property on the current room and syncs it to everyone.
Syntax:
photon_realtime_room_properties_set_bool(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | Boolean | The value to set. |
Returns:
Whether the property was set.
Removes a custom property from the current room.
Syntax:
photon_realtime_room_properties_remove(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key to remove. |
Returns:
Whether the property was removed.
Removes all custom properties from the current room.
Syntax:
photon_realtime_room_properties_clear()
Returns:
Whether the properties were cleared.
Returns whether the current room has a custom property with the given key.
Syntax:
photon_realtime_room_properties_has(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
Whether the property exists.
Returns a string custom property of the current room.
Syntax:
photon_realtime_room_properties_get_string(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns an integer custom property of the current room.
Syntax:
photon_realtime_room_properties_get_i32(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns a floating point custom property of the current room.
Syntax:
photon_realtime_room_properties_get_f64(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns a boolean custom property of the current room.
Syntax:
photon_realtime_room_properties_get_bool(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns a human-readable string of all the room's custom properties, useful for debugging.
Syntax:
photon_realtime_room_properties_to_string()
Returns:
A readable dump of the room properties.
Returns all of the room's custom properties as a GML struct.
Syntax:
photon_realtime_room_properties_get_all()
Returns:
A struct of all room custom properties.
Atomically sets a string room property only if its current value equals the expected value (compare-and-swap). If the check fails on the server, photon_realtime_set_callback_properties_change_failed fires. Returns false immediately if not in a room.
Syntax:
photon_realtime_room_properties_cas_string(key, expected_value, new_value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| expected_value | String | The value the property must currently have. |
| new_value | String | The value to set if the check passes. |
Returns:
Whether the request was sent.
Atomically sets an integer room property only if its current value equals the expected value (compare-and-swap). If the check fails on the server, photon_realtime_set_callback_properties_change_failed fires. Returns false immediately if not in a room.
Syntax:
photon_realtime_room_properties_cas_i32(key, expected_value, new_value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| expected_value | Real | The value the property must currently have. |
| new_value | Real | The value to set if the check passes. |
Returns:
Whether the request was sent.
Atomically sets a floating point room property only if its current value equals the expected value (compare-and-swap). If the check fails on the server, photon_realtime_set_callback_properties_change_failed fires. Returns false immediately if not in a room.
Syntax:
photon_realtime_room_properties_cas_f64(key, expected_value, new_value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| expected_value | Real | The value the property must currently have. |
| new_value | Real | The value to set if the check passes. |
Returns:
Whether the request was sent.
Atomically sets a boolean room property only if its current value equals the expected value (compare-and-swap). If the check fails on the server, photon_realtime_set_callback_properties_change_failed fires. Returns false immediately if not in a room.
Syntax:
photon_realtime_room_properties_cas_bool(key, expected_value, new_value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| expected_value | Boolean | The value the property must currently have. |
| new_value | Boolean | The value to set if the check passes. |
Returns:
Whether the request was sent.
GameMaker 2026