C# Class LoadbalancingPeer, source

A LoadbalancingPeer provides the operations and enum definitions needed to use the loadbalancing server app(s).
The LoadBalancingPeer does not keep a state, instead this is done by a LoadBalancingClient.
Inheritance: PhotonPeer
Exibir arquivo Open project: unityosgt/source

Public Methods

Method Description
LoadbalancingPeer ( IPhotonPeerListener listener, ConnectionProtocol protocolType ) : System
OpAuthenticate ( string appId, string appVersion ) : bool

Sends this app's appId and appVersion to identify this application server side.

This operation makes use of encryption, if it's established beforehand. See: EstablishEncryption(). Check encryption with IsEncryptionAvailable.

OpCreateRoom ( string gameID, bool isVisible, bool isOpen, byte maxPlayers, bool autoCleanUp, Hashtable customGameProperties, Hashtable customPlayerProperties, string customRoomPropertiesForLobby ) : bool

Don't use this method directly, unless you know how to cache and apply customActorProperties. The PhotonNetwork methods will handle player and room properties for you and call this method.

OpJoinLobby ( ) : bool

Joins the lobby on the Master Server, where you get a list of RoomInfos of currently open rooms. This is an async request which triggers a OnOperationResponse() call.

OpJoinRandomRoom ( Hashtable expectedGameProperties ) : bool the hashtable is (optionally) used to filter games: only those that fit the contained custom properties will be matched
OpJoinRoom ( string roomName, Hashtable playerProperties ) : bool

Joins a room by name and sets this player's properties.

OpLeaveLobby ( ) : bool

Leaves the lobby on the Master Server. This is an async request which triggers a OnOperationResponse() call.

OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId ) : bool

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.

OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers ) : bool

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.

OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int targetActors ) : bool

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.

OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int targetActors, EventCaching cache ) : bool

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.

OpSetCustomPropertiesOfActor ( int actorNr, Hashtable actorProperties, bool broadcast, byte channelId ) : bool
OpSetCustomPropertiesOfRoom ( Hashtable gameProperties, bool broadcast, byte channelId ) : bool
OpSetPropertiesOfRoom ( Hashtable gameProperties, bool broadcast, byte channelId ) : bool

Protected Methods

Method Description
OpSetPropertiesOfActor ( int actorNr, Hashtable actorProperties, bool broadcast, byte channelId ) : bool
OpSetPropertyOfRoom ( byte propCode, object value ) : void

Method Details

LoadbalancingPeer() public method

public LoadbalancingPeer ( IPhotonPeerListener listener, ConnectionProtocol protocolType ) : System
listener IPhotonPeerListener
protocolType ConnectionProtocol
return System

OpAuthenticate() public method

Sends this app's appId and appVersion to identify this application server side.
This operation makes use of encryption, if it's established beforehand. See: EstablishEncryption(). Check encryption with IsEncryptionAvailable.
public OpAuthenticate ( string appId, string appVersion ) : bool
appId string
appVersion string
return bool

OpCreateRoom() public method

Don't use this method directly, unless you know how to cache and apply customActorProperties. The PhotonNetwork methods will handle player and room properties for you and call this method.
public OpCreateRoom ( string gameID, bool isVisible, bool isOpen, byte maxPlayers, bool autoCleanUp, Hashtable customGameProperties, Hashtable customPlayerProperties, string customRoomPropertiesForLobby ) : bool
gameID string
isVisible bool
isOpen bool
maxPlayers byte
autoCleanUp bool
customGameProperties Hashtable
customPlayerProperties Hashtable
customRoomPropertiesForLobby string
return bool

OpJoinLobby() public method

Joins the lobby on the Master Server, where you get a list of RoomInfos of currently open rooms. This is an async request which triggers a OnOperationResponse() call.
public OpJoinLobby ( ) : bool
return bool

OpJoinRandomRoom() public method

the hashtable is (optionally) used to filter games: only those that fit the contained custom properties will be matched
public OpJoinRandomRoom ( Hashtable expectedGameProperties ) : bool
expectedGameProperties Hashtable
return bool

OpJoinRoom() public method

Joins a room by name and sets this player's properties.
public OpJoinRoom ( string roomName, Hashtable playerProperties ) : bool
roomName string
playerProperties Hashtable
return bool

OpLeaveLobby() public method

Leaves the lobby on the Master Server. This is an async request which triggers a OnOperationResponse() call.
public OpLeaveLobby ( ) : bool
return bool

OpRaiseEvent() public method

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.
public OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId ) : bool
eventCode byte Code for this "type" of event (use a code per "meaning" or content).
evData Hashtable Data to send. Hashtable that contains key-values of Photon serializable datatypes.
sendReliable bool Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.
channelId byte The "channel" to which this event should belong. Per channel, the sequence is kept in order.
return bool

OpRaiseEvent() public method

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.
public OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers ) : bool
eventCode byte Code for this "type" of event (use a code per "meaning" or content).
evData Hashtable Data to send. Hashtable that contains key-values of Photon serializable datatypes.
sendReliable bool Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.
channelId byte The "channel" to which this event should belong. Per channel, the sequence is kept in order.
cache EventCaching Use EventCaching options to store this event for players who join.
receivers ReceiverGroup ReceiverGroup defines to which group of players the event is passed on.
return bool

OpRaiseEvent() public method

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.
public OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int targetActors ) : bool
eventCode byte Code for this "type" of event (use a code per "meaning" or content).
evData Hashtable Data to send. Hashtable that contains key-values of Photon serializable datatypes.
sendReliable bool Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.
channelId byte The "channel" to which this event should belong. Per channel, the sequence is kept in order.
targetActors int Defines the target players who should receive the event (use only for small target groups).
return bool

OpRaiseEvent() public method

Used in a room to raise (send) an event to the other players. Multiple overloads expose different parameters to this frequently used operation.
public OpRaiseEvent ( byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int targetActors, EventCaching cache ) : bool
eventCode byte Code for this "type" of event (use a code per "meaning" or content).
evData Hashtable Data to send. Hashtable that contains key-values of Photon serializable datatypes.
sendReliable bool Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.
channelId byte The "channel" to which this event should belong. Per channel, the sequence is kept in order.
targetActors int Defines the target players who should receive the event (use only for small target groups).
cache EventCaching Use EventCaching options to store this event for players who join.
return bool

OpSetCustomPropertiesOfActor() public method

public OpSetCustomPropertiesOfActor ( int actorNr, Hashtable actorProperties, bool broadcast, byte channelId ) : bool
actorNr int
actorProperties Hashtable
broadcast bool
channelId byte
return bool

OpSetCustomPropertiesOfRoom() public method

public OpSetCustomPropertiesOfRoom ( Hashtable gameProperties, bool broadcast, byte channelId ) : bool
gameProperties Hashtable
broadcast bool
channelId byte
return bool

OpSetPropertiesOfActor() protected method

protected OpSetPropertiesOfActor ( int actorNr, Hashtable actorProperties, bool broadcast, byte channelId ) : bool
actorNr int
actorProperties Hashtable
broadcast bool
channelId byte
return bool

OpSetPropertiesOfRoom() public method

public OpSetPropertiesOfRoom ( Hashtable gameProperties, bool broadcast, byte channelId ) : bool
gameProperties Hashtable
broadcast bool
channelId byte
return bool

OpSetPropertyOfRoom() protected method

protected OpSetPropertyOfRoom ( byte propCode, object value ) : void
propCode byte
value object
return void