-
Notifications
You must be signed in to change notification settings - Fork 0
peer
This module holds the QA network-simulation controls and the shared low-level peer constants used across the extension.
Warning
Network simulation is a QA/debug aid. It is not supported by the bundled SDK build and the getters report as disabled; treat these functions as no-ops on the shipping platforms.
Simulate poor network conditions for testing:
- photon_peer_network_sim_get_enabled
- photon_peer_network_sim_set_enabled
- photon_peer_network_sim_set_lag
- photon_peer_network_sim_set_jitter
- photon_peer_network_sim_set_packet_loss
The Peer module defines the following shared constants:
- PhotonPeerState
- PhotonPeerConnectionProtocol
- PhotonPeerStatusCode
- PhotonPeerCoreErrorCode
- PhotonPeerLiteOperationCode
- PhotonPeerLiteEventCode
- PhotonPeerLiteParameterCode
Returns whether network simulation (artificial lag, jitter and packet loss) is enabled.
Syntax:
photon_peer_network_sim_get_enabled()
Returns:
Whether network simulation is enabled.
Enables or disables network simulation for testing poor network conditions.
Syntax:
photon_peer_network_sim_set_enabled(enabled)
| Argument | Type | Description |
|---|---|---|
| enabled | Boolean | Whether to enable network simulation. |
Returns:
Whether the value was set.
Sets the artificial incoming and outgoing lag, in milliseconds.
Syntax:
photon_peer_network_sim_set_lag(incoming_ms, outgoing_ms)
| Argument | Type | Description |
|---|---|---|
| incoming_ms | Real | The incoming lag in milliseconds. |
| outgoing_ms | Real | The outgoing lag in milliseconds. |
Returns:
Whether the values were set.
Sets the artificial incoming and outgoing jitter, in milliseconds.
Syntax:
photon_peer_network_sim_set_jitter(incoming_ms, outgoing_ms)
| Argument | Type | Description |
|---|---|---|
| incoming_ms | Real | The incoming jitter in milliseconds. |
| outgoing_ms | Real | The outgoing jitter in milliseconds. |
Returns:
Whether the values were set.
Sets the artificial incoming and outgoing packet-loss percentages.
Syntax:
photon_peer_network_sim_set_packet_loss(incoming_pct, outgoing_pct)
| Argument | Type | Description |
|---|---|---|
| incoming_pct | Real | The incoming packet-loss percentage. |
| outgoing_pct | Real | The outgoing packet-loss percentage. |
Returns:
Whether the values were set.
The transport protocols a peer can use.
| Member | Description |
|---|---|
Udp |
UDP transport. |
Tcp |
TCP transport. |
Ws |
WebSocket transport. |
Wss |
Secure WebSocket transport. |
The low-level peer connection states.
| Member | Description |
|---|---|
Disconnected |
The peer is disconnected. |
Connecting |
The peer is connecting. |
InitializingApplication |
The peer is initialising the application layer. |
Connected |
The peer is connected. |
Disconnecting |
The peer is disconnecting. |
Low-level peer status codes. Primarily useful for diagnostics.
| Member | Description |
|---|---|
ExceptionOnConnect |
An exception occurred while connecting. |
Connect |
The peer connected. |
Disconnect |
The peer disconnected. |
Exception |
A peer exception occurred. |
QueueOutgoingReliableWarning |
The outgoing reliable queue is filling up. |
QueueOutgoingUnreliableWarning |
The outgoing unreliable queue is filling up. |
SendError |
A send error occurred. |
QueueOutgoingAcksWarning |
The outgoing acknowledgement queue is filling up. |
QueueIncomingReliableWarning |
The incoming reliable queue is filling up. |
QueueIncomingUnreliableWarning |
The incoming unreliable queue is filling up. |
QueueSentWarning |
The sent queue is filling up. |
InternalReceiveException |
An internal receive exception occurred. |
TimeoutDisconnect |
The connection timed out. |
DisconnectByServer |
The server closed the connection. |
DisconnectByServerUserLimit |
The server closed the connection due to its user limit. |
DisconnectByServerLogic |
Server-side logic closed the connection. |
EncryptionEstablished |
Encryption was established. |
EncryptionFailedToEstablish |
Encryption failed to establish. |
Core (protocol-level) error codes. Primarily useful for diagnostics.
| Member | Description |
|---|---|
Ok |
No error. |
InternalServerError |
An internal server error occurred. |
OperationInvalid |
The operation was invalid. |
OperationDenied |
The operation was denied. |
ArgumentOutOfRange |
An argument was out of range. |
InvalidRequestParameters |
The request parameters were invalid. |
NotReady |
The server is not ready. |
Overload |
The server is overloaded. |
Backoff |
The client should back off and retry later. |
Maintenance |
The server is under maintenance. |
SendBufferFull |
The send buffer is full. |
UnexpectedData |
Unexpected data was received. |
SerializationLimitError |
A serialization limit was exceeded. |
WrongInitRequestData |
The initialization request data was wrong. |
ResponseParseError |
A response could not be parsed. |
CryptoProviderNotSet |
The crypto provider was not set. |
DecryptionFailure |
Decryption failed. |
InvalidEncryptionParameters |
The encryption parameters were invalid. |
IncomingDataRateExceeded |
The incoming data rate was exceeded. |
IncomingMsgRateExceeded |
The incoming message rate was exceeded. |
IncomingMaxMsgSizeExceeded |
The incoming maximum message size was exceeded. |
OperationMaxCountExceeded |
The operation count limit was exceeded. |
OperationRateExceeded |
The operation rate was exceeded. |
OperationDataRateExceeded |
The operation data rate was exceeded. |
OperationBlocked |
The operation was blocked. |
OperationSizeLimitExceeded |
The operation size limit was exceeded. |
OperationParametersLimit |
The operation parameters limit was exceeded. |
MessagesRateExceeded |
The message rate was exceeded. |
MessagesDataRateExceeded |
The message data rate was exceeded. |
MessagesBlocked |
Messages were blocked. |
MessageSizeLimitExceeded |
The message size limit was exceeded. |
The Lite protocol operation codes. Primarily useful for diagnostics.
| Member | Description |
|---|---|
Join |
Join a room. |
Leave |
Leave a room. |
RaiseEvent |
Raise an event. |
SetProperties |
Set properties. |
GetProperties |
Get properties. |
ChangeGroups |
Change interest groups. |
The Lite protocol event codes. Primarily useful for diagnostics.
| Member | Description |
|---|---|
Join |
A player joined. |
Leave |
A player left. |
PropertiesChanged |
Properties changed. |
The Lite protocol parameter codes. Primarily useful for diagnostics.
| Member | Description |
|---|---|
GameId |
The game ID parameter. |
ActorNr |
The actor number parameter. |
TargetActorNr |
The target actor number parameter. |
ActorList |
The actor list parameter. |
Properties |
The properties parameter. |
Broadcast |
The broadcast flag parameter. |
ActorProperties |
The actor properties parameter. |
GameProperties |
The game properties parameter. |
Cache |
The cache parameter. |
ReceiverGroup |
The receiver group parameter. |
Data |
The data parameter. |
Code |
The code parameter. |
Group |
The group parameter. |
Remove |
The remove parameter. |
Add |
The add parameter. |
GameMaker 2026