-
Notifications
You must be signed in to change notification settings - Fork 0
common
The Common module holds functionality shared across the Photon subsystems: SDK debug output control, serialization info, and helpers for turning Photon's numeric state, cause and type codes into readable strings.
The Common module provides the following functions:
- photon_common_set_debug_level
- photon_common_get_debug_level
- photon_common_get_serialization_protocol
- photon_common_type_code_to_string
- photon_common_get_sdk_version
- photon_common_client_state_to_string
- photon_common_disconnect_cause_to_string
The Common module defines the following constants:
- PhotonCommonDebugLevel
- PhotonCommonSerializationProtocol
- PhotonCommonTypeCode
- PhotonCommonInternalLogLevel
Sets the verbosity of the Photon SDK's internal debug output. Higher levels print more diagnostic information from the underlying client and are useful while developing, but should usually be lowered for release builds.
Syntax:
photon_common_set_debug_level(level)
| Argument | Type | Description |
|---|---|---|
| level | PhotonCommonDebugLevel | The debug output level to apply. |
Returns:
Whether the level was applied successfully.
Example:
photon_common_set_debug_level(PhotonCommonDebugLevel.Warnings);The above code limits the SDK debug output to warnings and errors.
Returns the current Photon SDK debug output level, as set by photon_common_set_debug_level.
Syntax:
photon_common_get_debug_level()
Returns:
The current debug output level.
Returns the serialization protocol the client uses to encode data on the wire.
Syntax:
photon_common_get_serialization_protocol()
Returns:
The active serialization protocol.
Converts a Photon wire type code into a human-readable string. This is primarily a debugging aid when inspecting the raw types received from custom events or properties.
Syntax:
photon_common_type_code_to_string(type_code)
| Argument | Type | Description |
|---|---|---|
| type_code | PhotonCommonTypeCode | The type code to convert. |
Returns:
A readable name for the type code.
Example:
show_debug_message(photon_common_type_code_to_string(PhotonCommonTypeCode.Integer)); // "Integer"Returns the version string of the underlying Photon C++ SDK bundled with the extension.
Syntax:
photon_common_get_sdk_version()
Returns:
The Photon SDK version.
Converts a client state value into a human-readable string. Pass a PhotonRealtimeState or PhotonChatState value depending on which client the state came from.
Syntax:
photon_common_client_state_to_string(state)
| Argument | Type | Description |
|---|---|---|
| state | Real | The client state value to convert. |
Returns:
A readable name for the state.
Converts a disconnect cause value into a human-readable string. Pass a PhotonRealtimeDisconnectCause or PhotonChatDisconnectCause value depending on which client reported the disconnect.
Syntax:
photon_common_disconnect_cause_to_string(cause)
| Argument | Type | Description |
|---|---|---|
| cause | Real | The disconnect cause value to convert. |
Returns:
A readable name for the disconnect cause.
The Photon SDK debug output levels, used with photon_common_set_debug_level and photon_common_get_debug_level.
These constants are referenced by the following functions:
- photon_chat_peer_get_debug_output_level
- photon_chat_peer_set_debug_output_level
- photon_common_set_debug_level
- photon_common_get_debug_level
- photon_realtime_peer_get_debug_output_level
- photon_realtime_peer_set_debug_output_level
| Member | Description |
|---|---|
Off |
No debug output. |
Errors |
Only errors. |
Warnings |
Errors and warnings. |
Info |
Errors, warnings and informational messages. |
All |
All debug output, including verbose messages. |
The serialization protocols the client can use to encode data on the wire, returned by photon_common_get_serialization_protocol.
These constants are referenced by the following functions:
| Member | Description |
|---|---|
Protocol16 |
Photon serialization protocol 1.6. |
Protocol18 |
Photon serialization protocol 1.8. |
The wire type codes Photon uses to tag serialized values. Returned in the readable form by photon_common_type_code_to_string, and useful when interpreting values received from custom events and properties.
These constants are referenced by the following functions:
| Member | Description |
|---|---|
Byte |
An 8-bit unsigned integer. |
Short |
A 16-bit signed integer. |
Integer |
A 32-bit signed integer. |
Long |
A 64-bit signed integer. |
Float |
A 32-bit floating point value. |
Double |
A 64-bit floating point value. |
Boolean |
A boolean value. |
String |
A string value. |
Hashtable |
A Photon hashtable. |
Dictionary |
A typed dictionary. |
Object |
A generic object. |
Array |
An array of typed values. |
ByteArray |
An array of bytes. |
PhotonCommand |
An internal Photon command. |
Null |
A null value. |
Custom |
A registered custom type. |
Unknown |
An unknown type. |
Invalid |
An invalid type. |
The extension's own logging levels (distinct from the Photon SDK debug level). This corresponds to the extension's Log Level option.
| Member | Description |
|---|---|
Off |
No logging. |
Fatal |
Only fatal errors. |
Error |
Errors and above. |
Warning |
Warnings and above. |
Info |
Informational messages and above. |
Debug |
Debug messages and above. |
DebugVerbose |
All messages, including verbose debug output. |
GameMaker 2026