Photon .NET Client API
Namespaces | Classes | Enumerations | Functions
Package ExitGames.Client.Photon

Namespaces

package  Chat
 
package  LoadBalancing
 

Classes

class  Hashtable
 This is a substitute for the Hashtable class, missing in: Win8RT and Windows Phone. It uses a Dictionary<object,object> as base. More...
 
class  DictionaryEntryEnumerator
 
class  EnetChannel
 
class  EnetPeer
 
class  InvocationCache
 
interface  IPhotonPeerListener
 Callback interface for the Photon client side. Must be provided to a new PhotonPeer in its constructor. More...
 
class  IPhotonSocket
 
class  NCommand
 Internal class for "commands" - the package in which operations are sent.
 
class  SimulationItem
 A simulation item is an action that can be queued to simulate network lag.
 
class  NetworkSimulationSet
 A set of network simulation settings, enabled (and disabled) by PhotonPeer.IsSimulationEnabled. More...
 
class  PhotonCodes
 
class  PeerBase
 
class  CmdLogItem
 
class  CmdLogReceivedReliable
 
class  CmdLogReceivedAck
 
class  CmdLogSentReliable
 
class  PhotonPeer
 Instances of the PhotonPeer class are used to connect to a Photon server and communicate with it. More...
 
class  PhotonPing
 
class  PingMono
 Uses C# Socket class from System.Net.Sockets (as Unity usually does). More...
 
class  PingWindowsStore
 
class  PingNativeStatic
 
class  PingNativeDynamic
 
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  EventData
 Contains all components of a Photon Event. Event Parameters, like OperationRequests and OperationResults, consist of a Dictionary with byte-typed keys per value. More...
 
class  CustomType
 
class  Protocol
 Provides tools for the Exit Games Protocol More...
 
class  Protocol17
 
class  SocketTcp
 Internal class to encapsulate the network i/o functionality for the realtime libary.
 
class  SocketUdp
 Internal class to encapsulate the network i/o functionality for the realtime libary.
 
class  SocketUdpAsync
 Internal class to encapsulate the network i/o functionality for the realtime libary.
 
class  SocketUdpNativeDynamic
 
class  SocketUdpNativeStatic
 
class  SupportClass
 Contains several (more or less) useful static methods, mostly used for debugging. More...
 
class  TPeer
 
class  TrafficStatsGameLevel
 Only in use as long as PhotonPeer.TrafficStatsEnabled = true; More...
 
class  TrafficStats
 

Enumerations

enum  StatusCode : int {
  StatusCode.Connect = 1024, StatusCode.Disconnect = 1025, StatusCode.Exception = 1026, StatusCode.ExceptionOnConnect = 1023,
  StatusCode.SecurityExceptionOnConnect = 1022, StatusCode.QueueOutgoingReliableWarning = 1027, StatusCode.QueueOutgoingUnreliableWarning = 1029, StatusCode.SendError = 1030,
  StatusCode.QueueOutgoingAcksWarning = 1031, StatusCode.QueueIncomingReliableWarning = 1033, StatusCode.QueueIncomingUnreliableWarning = 1035, StatusCode.QueueSentWarning = 1037,
  StatusCode.ExceptionOnReceive = 1039, StatusCode.InternalReceiveException = 1039, StatusCode.TimeoutDisconnect = 1040, StatusCode.DisconnectByServer = 1041,
  StatusCode.DisconnectByServerUserLimit = 1042, StatusCode.DisconnectByServerLogic = 1043, StatusCode.TcpRouterResponseOk = 1044, StatusCode.TcpRouterResponseNodeIdUnknown = 1045,
  StatusCode.TcpRouterResponseEndpointUnknown = 1046, StatusCode.TcpRouterResponseNodeNotReady = 1047, 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  PhotonDisconnectCause {
  PhotonDisconnectCause.SecurityExceptionOnConnect, PhotonDisconnectCause.ExceptionOnConnect, PhotonDisconnectCause.Exception, PhotonDisconnectCause.ReadException,
  PhotonDisconnectCause.WriteException
}
 
enum  PhotonSocketError { PhotonSocketError.Success, PhotonSocketError.Skipped, PhotonSocketError.NoData, PhotonSocketError.Exception }
 
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...
 

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 (MemoryStream outStream, object customObject)
 
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 (MemoryStream inStream, short length)
 

Enumeration Type Documentation

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 

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.

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.

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.

Enumerator
SecurityExceptionOnConnect 
ExceptionOnConnect 
Exception 
ReadException 
WriteException 
Enumerator
Success 
Skipped 
NoData 
Exception 
Enumerator
Disconnected 
Connecting 
Connected 
Disconnecting 

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 

the PhotonPeer encountered an exception while opening the incoming connection to the server. 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.

QueueOutgoingReliableWarning 

PhotonPeer outgoing queue is filling up. send more often.

QueueOutgoingUnreliableWarning 

PhotonPeer outgoing queue is filling up. send more often.

SendError 

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

QueueOutgoingAcksWarning 

PhotonPeer outgoing queue is filling up. send more often.

QueueIncomingReliableWarning 

PhotonPeer incoming queue is filling up. Dispatch more often.

QueueIncomingUnreliableWarning 

PhotonPeer incoming queue is filling up. Dispatch more often.

QueueSentWarning 

PhotonPeer incoming queue is filling up. Dispatch more often.

ExceptionOnReceive 

Exception, if a server cannot be connected. Most likely, the server is not responding. Ask user to try again later.

InternalReceiveException 

Exception, if a server cannot be connected. 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).

DisconnectByServer 

Disconnect by server due to timeout (received a disconnect command, cause server misses ACKs of client).

DisconnectByServerUserLimit 

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

DisconnectByServerLogic 

Disconnect by server due to server's logic (received a disconnect command).

TcpRouterResponseOk 

Tcp Router Response. Only used when Photon is setup as TCP router! Routing is ok.

TcpRouterResponseNodeIdUnknown 

Tcp Router Response. Only used when Photon is setup as TCP router! Routing node unknown. Check client connect values.

TcpRouterResponseEndpointUnknown 

Tcp Router Response. Only used when Photon is setup as TCP router! Routing endpoint unknown.

TcpRouterResponseNodeNotReady 

Tcp Router Response. Only used when Photon is setup as TCP router! Routing not setup yet. Connect again.

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.

Function Documentation

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().
delegate object ExitGames.Client.Photon.DeserializeStreamMethod ( MemoryStream  inStream,
short  length 
)
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.
delegate short ExitGames.Client.Photon.SerializeStreamMethod ( MemoryStream  outStream,
object  customObject 
)