Photon .NET Client API 4.1.4.8

Namespaces | Classes | Enumerations | Functions
ExitGames.Client.Photon Namespace Reference

Namespaces

namespace  Encryption
 
namespace  StructWrapping
 

Classes

class  ByteArraySlice
 A slice of memory that should be pooled and reused. Wraps a byte-array. More...
 
class  ByteArraySlicePool
 Tiered pool for ByteArraySlices. Reduces the allocations once enough slices are available. More...
 
class  CustomType
 
class  DisconnectMessage
 
class  EnetChannel
 
class  EnetPeer
 
class  EventData
 A Photon Event consists of a Code value and a Parameters Dictionary with the event's content (if any). More...
 
class  InvalidDataException
 Exception type for de/serialization issues. Used in Protocol 1.8. More...
 
interface  IPhotonPeerListener
 Callback interface for the Photon client side. Must be provided to a new PhotonPeer in its constructor. More...
 
class  IPhotonSocket
 
class  IProtocol
 
interface  ITrafficRecorder
 Interface for (UDP) traffic capturing. More...
 
class  NCommand
 Internal class for "commands" - the package in which operations are sent.
 
class  NCommandPool
 
class  NetworkSimulationSet
 A set of network simulation settings, enabled (and disabled) by PhotonPeer.IsSimulationEnabled. More...
 
class  NonAllocDictionary
 Replacement for Dictionary<K,V> which does not allocate memory during usage. More...
 
class  OperationRequest
 Container for an Operation request, which is a code and parameters. More...
 
class  OperationResponse
 Contains the server's response for an operation called by this peer. The indexer of this class actually provides access to the Parameters Dictionary. More...
 
class  ParameterDictionary
 
class  PeerBase
 
class  PhotonCodes
 
class  PhotonPeer
 Instances of the PhotonPeer class are used to connect to a Photon server and communicate with it. More...
 
class  Pool
 
class  PreserveAttribute
 An Attribute named "Preserve" tells Unity to not strip the code. More...
 
class  Protocol
 Provides tools for the Exit Games Protocol More...
 
class  Protocol16
 Exit Games GpBinaryV16 protocol implementation More...
 
class  Protocol18
 
struct  SendOptions
 Wraps up DeliveryMode, Encryption and Channel values for sending operations and messages. More...
 
class  SerializationProtocolFactory
 
class  SimulationItem
 A simulation item is an action that can be queued to simulate network lag.
 
class  SocketNative
 
class  SocketTcp
 Encapsulates the network i/o functionality for the realtime library. More...
 
class  SocketTcpAsync
 Internal class to encapsulate the network i/o functionality for the realtime libary. More...
 
class  SocketUdp
 Encapsulates the network i/o functionality for the realtime library. More...
 
class  SocketUdpAsync
 Internal class to encapsulate the network i/o functionality for the realtime libary. More...
 
class  StreamBuffer
 
class  SupportClass
 Contains several (more or less) useful static methods, mostly used for debugging. More...
 
class  TPeer
 
class  TrafficStats
 
class  TrafficStatsGameLevel
 Only in use as long as PhotonPeer.TrafficStatsEnabled = true; More...
 
class  Version
 

Enumerations

enum  StatusCode : int {
  StatusCode.Connect = 1024, StatusCode.Disconnect = 1025, StatusCode.Exception = 1026, StatusCode.ExceptionOnConnect = 1023,
  StatusCode.SecurityExceptionOnConnect = 1022, StatusCode.SendError = 1030, StatusCode.ExceptionOnReceive = 1039, StatusCode.TimeoutDisconnect = 1040,
  StatusCode.DisconnectByServerTimeout = 1041, StatusCode.DisconnectByServerUserLimit = 1042, StatusCode.DisconnectByServerLogic = 1043, StatusCode.DisconnectByServerReasonUnknown = 1044,
  StatusCode.EncryptionEstablished = 1048, StatusCode.EncryptionFailedToEstablish = 1049
}
 Enumeration of situations that change the peers internal status. Used in calls to OnStatusChanged to inform your application of various situations that might happen. More...
 
enum  PhotonSocketState { PhotonSocketState.Disconnected, PhotonSocketState.Connecting, PhotonSocketState.Connected, PhotonSocketState.Disconnecting }
 
enum  PhotonSocketError {
  PhotonSocketError.Success, PhotonSocketError.Skipped, PhotonSocketError.NoData, PhotonSocketError.Exception,
  PhotonSocketError.Busy
}
 
enum  SerializationProtocol { SerializationProtocol.GpBinaryV16, SerializationProtocol.GpBinaryV18 }
 Variants of the Photon specific serialization protocol used for operations, responses, events and data. More...
 
enum  ConnectionStateValue : byte {
  ConnectionStateValue.Disconnected = 0, ConnectionStateValue.Connecting = 1, ConnectionStateValue.Connected = 3, ConnectionStateValue.Disconnecting = 4,
  ConnectionStateValue.AcknowledgingDisconnect = 5, ConnectionStateValue.Zombie = 6
}
 This is the replacement for the const values used in eNet like: PS_DISCONNECTED, PS_CONNECTED, etc. More...
 
enum  PeerStateValue : byte {
  PeerStateValue.Disconnected = 0, PeerStateValue.Connecting = 1, PeerStateValue.InitializingApplication = 10, PeerStateValue.Connected = 3,
  PeerStateValue.Disconnecting = 4
}
 Value range for a Peer's connection and initialization state, as returned by the PeerState property. More...
 
enum  ConnectionProtocol : byte { ConnectionProtocol.Udp = 0, ConnectionProtocol.Tcp = 1, ConnectionProtocol.WebSocket = 4, ConnectionProtocol.WebSocketSecure = 5 }
 These are the options that can be used as underlying transport protocol. More...
 
enum  DebugLevel : byte {
  DebugLevel.OFF = 0, DebugLevel.ERROR = 1, DebugLevel.WARNING = 2, DebugLevel.INFO = 3,
  DebugLevel.ALL = 5
}
 Level / amount of DebugReturn callbacks. Each debug level includes output for lower ones: OFF, ERROR, WARNING, INFO, ALL. More...
 
enum  TargetFrameworks { TargetFrameworks.Unknown, TargetFrameworks.Net35, TargetFrameworks.NetStandard20, TargetFrameworks.Metro }
 Build target framework supported by this dll. More...
 
enum  DeliveryMode { DeliveryMode.Unreliable = 0, DeliveryMode.Reliable, DeliveryMode.UnreliableUnsequenced, DeliveryMode.ReliableUnsequenced }
 Enum of the three options for reliability and sequencing in Photon's reliable-UDP. More...
 

Functions

delegate byte[] SerializeMethod (object customObject)
 Type of serialization methods to add custom type support. Use PhotonPeer.ReisterType() to register new types with serialization and deserialization methods. More...
 
delegate short SerializeStreamMethod (StreamBuffer outStream, object customObject)
 Serialization method delegate. StreamBuffer based custom serialization methods must use this form. More...
 
delegate object DeserializeMethod (byte[] serializedCustomObject)
 Type of deserialization methods to add custom type support. Use PhotonPeer.RegisterType() to register new types with serialization and deserialization methods. More...
 
delegate object DeserializeStreamMethod (StreamBuffer inStream, short length)
 Deserialization method delegate. StreamBuffer based custom deserialization methods must use this form. More...
 

Enumeration Type Documentation

◆ ConnectionProtocol

These are the options that can be used as underlying transport protocol.

Enumerator
Udp 

Use UDP to connect to Photon, which allows you to send operations reliable or unreliable on demand.

Tcp 

Use TCP to connect to Photon.

WebSocket 

Use Realtime HTTP connections to connect a Photon Master (not available in regular Photon SDK).

A TCP-based protocol commonly supported by browsers.For WebGL games mostly. Note: No WebSocket IPhotonSocket implementation is in this Assembly.

This protocol is only available in Unity exports to WebGL.

WebSocketSecure 

A TCP-based, encrypted protocol commonly supported by browsers. For WebGL games mostly. Note: No WebSocket IPhotonSocket implementation is in this Assembly.

This protocol is only available in Unity exports to WebGL.

◆ ConnectionStateValue

This is the replacement for the const values used in eNet like: PS_DISCONNECTED, PS_CONNECTED, etc.

Enumerator
Disconnected 

No connection is available. Use connect.

Connecting 

Establishing a connection already. The app should wait for a status callback.

Connected 

The low level connection with Photon is established. On connect, the library will automatically send an Init package to select the application it connects to (see also PhotonPeer.Connect()). When the Init is done, IPhotonPeerListener.OnStatusChanged() is called with connect.

Please note that calling operations is only possible after the OnStatusChanged() with StatusCode.Connect.

Disconnecting 

Connection going to be ended. Wait for status callback.

AcknowledgingDisconnect 

Acknowledging a disconnect from Photon. Wait for status callback.

Zombie 

Connection not properly disconnected.

◆ DebugLevel

Level / amount of DebugReturn callbacks. Each debug level includes output for lower ones: OFF, ERROR, WARNING, INFO, ALL.

Enumerator
OFF 

No debug out.

ERROR 

Only error descriptions.

WARNING 

Warnings and errors.

INFO 

Information about internal workflows, warnings and errors.

ALL 

Most complete workflow description (but lots of debug output), info, warnings and errors.

◆ DeliveryMode

Enum of the three options for reliability and sequencing in Photon's reliable-UDP.

Enumerator
Unreliable 

The operation/message gets sent just once without acknowledgement or repeat. The sequence (order) of messages is guaranteed.

Reliable 

The operation/message asks for an acknowledgment. It's resent until an ACK arrived. The sequence (order) of messages is guaranteed.

UnreliableUnsequenced 

The operation/message gets sent once (unreliable) and might arrive out of order. Best for your own sequencing (e.g. for streams).

ReliableUnsequenced 

The operation/message asks for an acknowledgment. It's resent until an ACK arrived and might arrive out of order. Best for your own sequencing (e.g. for streams).

◆ PeerStateValue

Value range for a Peer's connection and initialization state, as returned by the PeerState property.

While this is not the same as the StatusCode of IPhotonPeerListener.OnStatusChanged(), it directly relates to it. In most cases, it makes more sense to build a game's state on top of the OnStatusChanged() as you get changes.

Enumerator
Disconnected 

The peer is disconnected and can't call Operations. Call Connect().

Connecting 

The peer is establishing the connection: opening a socket, exchanging packages with Photon.

InitializingApplication 

The connection is established and now sends the application name to Photon.

You set the "application name" by calling PhotonPeer.Connect().

Connected 

The peer is connected and initialized (selected an application). You can now use operations.

Disconnecting 

The peer is disconnecting. It sent a disconnect to the server, which will acknowledge closing the connection.

◆ PhotonSocketError

Enumerator
Success 
Skipped 
NoData 
Exception 
Busy 

◆ PhotonSocketState

Enumerator
Disconnected 
Connecting 
Connected 
Disconnecting 

◆ SerializationProtocol

Variants of the Photon specific serialization protocol used for operations, responses, events and data.

Enumerator
GpBinaryV16 

Version 1.6 (outdated).

GpBinaryV18 

Version 1.8.

◆ StatusCode

Enumeration of situations that change the peers internal status. Used in calls to OnStatusChanged to inform your application of various situations that might happen.

Most of these codes are referenced somewhere else in the documentation when they are relevant to methods.

Enumerator
Connect 

the PhotonPeer is connected.
See PhotonListener#OnStatusChanged*

Disconnect 

the PhotonPeer just disconnected.
See PhotonListener#OnStatusChanged*

Exception 

the PhotonPeer encountered an exception and will disconnect, too.
See PhotonListener#OnStatusChanged*

ExceptionOnConnect 

Exception while opening the incoming connection to the server. Followed by Disconnect.

The server could be down / not running or the client has no network or a misconfigured DNS.
See PhotonListener#OnStatusChanged*

SecurityExceptionOnConnect 

Used on platforms that throw a security exception on connect. Unity3d does this, e.g., if a webplayer build could not fetch a policy-file from a remote server.

SendError 

Sending command failed. Either not connected, or the requested channel is bigger than the number of initialized channels.

ExceptionOnReceive 

Exception, if a server cannot be connected. Followed by Disconnect.

Most likely, the server is not responding. Ask user to try again later.

TimeoutDisconnect 

Disconnection due to a timeout (client did no longer receive ACKs from server). Followed by Disconnect.

DisconnectByServerTimeout 

Timeout disconnect by server. The server didn't receive necessary ACKs in time. Followed by Disconnect.

DisconnectByServerUserLimit 

Disconnect by server due to concurrent user limit reached (received a disconnect command).

DisconnectByServerLogic 

(1043) Disconnect by server due to server's logic. Followed by Disconnect.

DisconnectByServerReasonUnknown 

Disconnect by server due to unspecified reason. Followed by Disconnect.

EncryptionEstablished 

(1048) Value for OnStatusChanged()-call, when the encryption-setup for secure communication finished successfully.

EncryptionFailedToEstablish 

(1049) Value for OnStatusChanged()-call, when the encryption-setup failed for some reason. Check debug logs.

◆ TargetFrameworks

Build target framework supported by this dll.

Enumerator
Unknown 
Net35 
NetStandard20 
Metro 

Function Documentation

◆ DeserializeMethod()

delegate object ExitGames.Client.Photon.DeserializeMethod ( byte[]  serializedCustomObject)

Type of deserialization methods to add custom type support. Use PhotonPeer.RegisterType() to register new types with serialization and deserialization methods.

Parameters
serializedCustomObjectThe framwork passes in the data it got by the associated SerializeMethod. The type code and length are stripped and applied before a DeserializeMethod is called.
Returns
Return a object of the type that was associated with this method through RegisterType().

◆ DeserializeStreamMethod()

delegate object ExitGames.Client.Photon.DeserializeStreamMethod ( StreamBuffer  inStream,
short  length 
)

Deserialization method delegate. StreamBuffer based custom deserialization methods must use this form.

◆ SerializeMethod()

delegate byte [] ExitGames.Client.Photon.SerializeMethod ( object  customObject)

Type of serialization methods to add custom type support. Use PhotonPeer.ReisterType() to register new types with serialization and deserialization methods.

Parameters
customObjectThe method will get objects passed that were registered with it in RegisterType().
Returns
Return a byte[] that resembles the object passed in. The framework will surround it with length and type info, so don't include it.

◆ SerializeStreamMethod()

delegate short ExitGames.Client.Photon.SerializeStreamMethod ( StreamBuffer  outStream,
object  customObject 
)

Serialization method delegate. StreamBuffer based custom serialization methods must use this form.