Photon .NET Client API
Classes | Enumerations
Package ExitGames.Client.Photon.LoadBalancing

Classes

class  Extensions
 
class  FriendInfo
 
class  LoadBalancingClient
 This class implements the Photon LoadBalancing workflow by using a LoadBalancingPeer. It keeps a state and will automatically execute transitions between the Master and Game Servers. More...
 
class  LoadBalancingPeer
 A LoadbalancingPeer provides the operations and enum definitions needed to use the loadbalancing server application which is also used in Photon Cloud. More...
 
class  ErrorCode
 ErrorCode defines the default codes associated with Photon client/server communication. More...
 
class  ActorProperties
 These (byte) values define "well known" properties for an Actor / Player. More...
 
class  GamePropertyKey
 Class for constants. These (byte) values are for "well known" room/game properties used in Photon Loadbalancing. More...
 
class  EventCode
 These values are for events defined by Photon Loadbalancing. More...
 
class  ParameterCode
 Class for constants. Codes for parameters of Operations and Events. More...
 
class  OperationCode
 Codes for parameters and events used in PhotonLoadbalancingAPI More...
 
class  RoomOptions
 Wraps up common room properties needed when you create rooms. Read the individual entries for more details. More...
 
class  RaiseEventOptions
 Aggregates several less-often used options for operation RaiseEvent. See field descriptions for usage details. More...
 
class  TypedLobby
 Refers to a specific lobby (and type) on the server. More...
 
class  TypedLobbyInfo
 
class  AuthenticationValues
 Container for user authentication in Photon. Set AuthValues before you connect - all else is handled. More...
 
class  Player
 Summarizes a "player" within a room, identified (in that room) by ID (or "actorID"). More...
 
class  Room
 This class represents a room a client joins/joined. Mostly used through LoadBalancingClient.CurrentRoom, after joining any room. Contains a list of current players, their properties and those of this room, too. A room instance has a number of "well known" properties like IsOpen, MaxPlayers which can be changed. Your own, custom properties can be set via SetCustomProperties() while being in the room. More...
 
class  RoomInfo
 Used for Room listings of the lobby (not yet joining). Offers the basic info about a room: name, player counts, properties, etc. More...
 

Enumerations

enum  ClientState {
  ClientState.Uninitialized, ClientState.ConnectingToMasterserver, ClientState.ConnectedToMaster, ClientState.Queued,
  ClientState.Authenticated, ClientState.JoinedLobby, ClientState.DisconnectingFromMasterserver, ClientState.ConnectingToGameserver,
  ClientState.ConnectedToGameserver, ClientState.Joining, ClientState.Joined, ClientState.Leaving,
  ClientState.Left, ClientState.DisconnectingFromGameserver, ClientState.QueuedComingFromGameserver, ClientState.Disconnecting,
  ClientState.Disconnected, ClientState.ConnectingToNameServer, ClientState.ConnectedToNameServer, ClientState.Authenticating,
  ClientState.DisconnectingFromNameServer
}
 Possible states for a LoadBalancingClient. More...
 
enum  JoinType { JoinType.CreateRoom, JoinType.JoinRoom, JoinType.JoinRandomRoom, JoinType.JoinOrCreateRoom }
 Ways a room can be created or joined. More...
 
enum  DisconnectCause {
  DisconnectCause.None, DisconnectCause.DisconnectByServerUserLimit, DisconnectCause.ExceptionOnConnect, DisconnectCause.DisconnectByServer,
  DisconnectCause.TimeoutDisconnect, DisconnectCause.Exception, DisconnectCause.InvalidAuthentication, DisconnectCause.MaxCcuReached,
  DisconnectCause.InvalidRegion, DisconnectCause.OperationNotAllowedInCurrentState, DisconnectCause.CustomAuthenticationFailed
}
 Enumaration of causes for Disconnects (used in LoadBalancingClient.DisconnectedCause). More...
 
enum  JoinMode : byte { JoinMode.Default = 0, JoinMode.CreateIfNotExists = 1, JoinMode.JoinOrRejoin = 2, JoinMode.RejoinOnly = 3 }
 Defines possible values for OpJoinRoom and OpJoinOrCreate. It tells the server if the room can be only be joined normally, created implicitly or found on a web-service for Turnbased games. More...
 
enum  MatchmakingMode : byte { MatchmakingMode.FillRoom = 0, MatchmakingMode.SerialMatching = 1, MatchmakingMode.RandomMatching = 2 }
 Options for matchmaking rules for OpJoinRandom. More...
 
enum  ReceiverGroup : byte { ReceiverGroup.Others = 0, ReceiverGroup.All = 1, ReceiverGroup.MasterClient = 2 }
 Lite - OpRaiseEvent lets you chose which actors in the room should receive events. By default, events are sent to "Others" but you can overrule this. More...
 
enum  EventCaching : byte {
  EventCaching.DoNotCache = 0, EventCaching.MergeCache = 1, EventCaching.ReplaceCache = 2, EventCaching.RemoveCache = 3,
  EventCaching.AddToRoomCache = 4, EventCaching.AddToRoomCacheGlobal = 5, EventCaching.RemoveFromRoomCache = 6, EventCaching.RemoveFromRoomCacheForActorsLeft = 7,
  EventCaching.SliceIncreaseIndex = 10, EventCaching.SliceSetIndex = 11, EventCaching.SlicePurgeIndex = 12, EventCaching.SlicePurgeUpToIndex = 13
}
 Lite - OpRaiseEvent allows you to cache events and automatically send them to joining players in a room. Events are cached per event code and player: Event 100 (example!) can be stored once per player. Cached events can be modified, replaced and removed. More...
 
enum  PropertyTypeFlag : byte { PropertyTypeFlag.None = 0x00, PropertyTypeFlag.Game = 0x01, PropertyTypeFlag.Actor = 0x02, PropertyTypeFlag.GameAndActor = Game | Actor }
 Flags for "types of properties", being used as filter in OpGetProperties. More...
 
enum  LobbyType : byte { LobbyType.Default = 0, LobbyType.SqlLobby = 2, LobbyType.AsyncRandomLobby = 3 }
 Options of lobby types available. Lobby types might be implemented in certain Photon versions and won't be available on older servers. More...
 
enum  CustomAuthenticationType : byte { CustomAuthenticationType.Custom = 0, CustomAuthenticationType.Steam = 1, CustomAuthenticationType.Facebook = 2, CustomAuthenticationType.None = byte.MaxValue }
 Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon. More...
 

Enumeration Type Documentation

Possible states for a LoadBalancingClient.

Enumerator
Uninitialized 

Peer is created but not used yet.

ConnectingToMasterserver 

Connecting to master (includes connect, authenticate and joining the lobby)

ConnectedToMaster 

Connected to master server.

Queued 

Currently not used.

Authenticated 

Usually when Authenticated, the client will join a game or the lobby (if AutoJoinLobby is true).

JoinedLobby 

Connected to master and joined lobby. Display room list and join/create rooms at will.

DisconnectingFromMasterserver 

Transition from master to game server.

ConnectingToGameserver 

Transition to gameserver (client will authenticate and join/create game).

ConnectedToGameserver 

Connected to gameserver (going to auth and join game).

Joining 

Joining game on gameserver.

Joined 

The client arrived inside a room. CurrentRoom and Players are known. Send events with OpRaiseEvent.

Leaving 

Currently not used. Instead of OpLeave, the client disconnects from a server (which also triggers a leave immediately).

Left 

Currently not used.

DisconnectingFromGameserver 

Transition from gameserver to master (after leaving a room/game).

QueuedComingFromGameserver 

Currently not used.

Disconnecting 

The client disconnects (from any server).

Disconnected 

The client is no longer connected (to any server). Connect to master to go on.

ConnectingToNameServer 

Client connects to the NameServer. This process includes low level connecting and setting up encryption. When done, state becomes ConnectedToNameServer.

ConnectedToNameServer 

Client is connected to the NameServer and established enctryption already. You should call OpGetRegions or ConnectToRegionMaster.

Authenticating 

Client authenticates itself with the server. On the Photon Cloud this sends the AppId of your game. Used with Master Server and Game Server.

DisconnectingFromNameServer 

Clients disconnects (specifically) from the NameServer to reconnect to the master server.

Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon.

Enumerator
Custom 

Use a custom authentification service. Currently the only implemented option.

Steam 

Authenticates users by their Steam Account. Set auth values accordingly!

Facebook 

Authenticates users by their Facebook Account. Set auth values accordingly!

None 

Disables custom authentification. Same as not providing any AuthenticationValues for connect (more precisely for: OpAuthenticate).

Enumaration of causes for Disconnects (used in LoadBalancingClient.DisconnectedCause).

Read the individual descriptions to find out what to do about this type of disconnect.

Enumerator
None 

No error was tracked.

DisconnectByServerUserLimit 

OnStatusChanged: The CCUs count of your Photon Server License is exausted (temporarily).

ExceptionOnConnect 

OnStatusChanged: The server is not available or the address is wrong. Make sure the port is provided and the server is up.

DisconnectByServer 

OnStatusChanged: The server disconnected this client. Most likely the server's send buffer is full (receiving too much from other clients).

TimeoutDisconnect 

OnStatusChanged: This client detected that the server's responses are not received in due time. Maybe you send / receive too much?

Exception 

OnStatusChanged: Some internal exception caused the socket code to fail. Contact Exit Games.

InvalidAuthentication 

OnOperationResponse: Authenticate in the Photon Cloud with invalid AppId. Update your subscription or contact Exit Games.

MaxCcuReached 

OnOperationResponse: Authenticate (temporarily) failed when using a Photon Cloud subscription without CCU Burst. Update your subscription.

InvalidRegion 

OnOperationResponse: Authenticate when the app's Photon Cloud subscription is locked to some (other) region(s). Update your subscription or master server address.

OperationNotAllowedInCurrentState 

OnOperationResponse: Operation that's (currently) not available for this client (not authorized usually). Only tracked for op Authenticate.

CustomAuthenticationFailed 

OnOperationResponse: Authenticate in the Photon Cloud with invalid client values or custom authentication setup in Cloud Dashboard.

Lite - OpRaiseEvent allows you to cache events and automatically send them to joining players in a room. Events are cached per event code and player: Event 100 (example!) can be stored once per player. Cached events can be modified, replaced and removed.

Caching works only combination with ReceiverGroup options Others and All.

Enumerator
DoNotCache 

Default value (not sent).

MergeCache 

Will merge this event's keys with those already cached.

ReplaceCache 

Replaces the event cache for this eventCode with this event's content.

RemoveCache 

Removes this event (by eventCode) from the cache.

AddToRoomCache 

Adds an event to the room's cache

AddToRoomCacheGlobal 

Adds this event to the cache for actor 0 (becoming a "globally owned" event in the cache).

RemoveFromRoomCache 

Remove fitting event from the room's cache.

RemoveFromRoomCacheForActorsLeft 

Removes events of players who already left the room (cleaning up).

SliceIncreaseIndex 

Increase the index of the sliced cache.

SliceSetIndex 

Set the index of the sliced cache. You must set RaiseEventOptions.CacheSliceIndex for this.

SlicePurgeIndex 

Purge cache slice with index. Exactly one slice is removed from cache. You must set RaiseEventOptions.CacheSliceIndex for this.

SlicePurgeUpToIndex 

Purge cache slices with specified index and anything lower than that. You must set RaiseEventOptions.CacheSliceIndex for this.

Defines possible values for OpJoinRoom and OpJoinOrCreate. It tells the server if the room can be only be joined normally, created implicitly or found on a web-service for Turnbased games.

These values are not directly used by a game but implicitly set.

Enumerator
Default 

Regular join. The room must exist.

CreateIfNotExists 

Join or create the room if it's not existing. Used for OpJoinOrCreate for example.

JoinOrRejoin 

The room might be out of memory and should be loaded (if possible) from a Turnbased web-service.

RejoinOnly 

Only re-join will be allowed. If the user is not yet in the room, this will fail.

Ways a room can be created or joined.

Enumerator
CreateRoom 

This client creates a room, gets into it (no need to join) and can set room properties.

JoinRoom 

The room existed already and we join into it (not setting room properties).

JoinRandomRoom 

Done on Master Server and (if successful) followed by a Join on Game Server.

JoinOrCreateRoom 

Client is either joining or creating a room. On Master- and Game-Server.

Options of lobby types available. Lobby types might be implemented in certain Photon versions and won't be available on older servers.

Enumerator
Default 

This lobby is used unless another is defined by game or JoinRandom. Room-lists will be sent and JoinRandomRoom can filter by matching properties.

SqlLobby 

This lobby type lists rooms like Default but JoinRandom has a parameter for SQL-like "where" clauses for filtering. This allows bigger, less, or and and combinations.

AsyncRandomLobby 

This lobby does not send lists of games. It is only used for OpJoinRandomRoom. It keeps rooms available for a while when there are only inactive users left.

Options for matchmaking rules for OpJoinRandom.

Enumerator
FillRoom 

Fills up rooms (oldest first) to get players together as fast as possible. Default.

Makes most sense with MaxPlayers > 0 and games that can only start with more players.

SerialMatching 

Distributes players across available rooms sequentially but takes filter into account. Without filter, rooms get players evenly distributed.

RandomMatching 

Joins a (fully) random room. Expected properties must match but aside from this, any available room might be selected.

Flags for "types of properties", being used as filter in OpGetProperties.

Enumerator
None 

(0x00) Flag type for no property type.

Game 

(0x01) Flag type for game-attached properties.

Actor 

(0x02) Flag type for actor related propeties.

GameAndActor 

(0x01) Flag type for game AND actor properties. Equal to 'Game'

Lite - OpRaiseEvent lets you chose which actors in the room should receive events. By default, events are sent to "Others" but you can overrule this.

Enumerator
Others 

Default value (not sent). Anyone else gets my event.

All 

Everyone in the current room (including this peer) will get this event.

MasterClient 

The server sends this event only to the actor with the lowest actorNumber.

The "master client" does not have special rights but is the one who is in this room the longest time.