C# Class ExitGames.Client.Photon.LoadbalancingPeer

Internally used by PUN, a LoadbalancingPeer provides the operations and enum definitions needed to use the Photon Loadbalancing server (or the Photon Cloud).
The LoadBalancingPeer does not keep a state, instead this is done by a LoadBalancingClient.
Inheritance: PhotonPeer
Afficher le fichier Open project: hydrater/Lucid

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
LoadbalancingPeer ( IPhotonPeerListener listener, ConnectionProtocol protocolType ) : ExitGames.Client.Photon
OpAuthenticate ( string appId, string appVersion, AuthenticationValues authValues, string regionCode ) : bool

Sends this app's appId and appVersion to identify this application server side. This is an async request which triggers a OnOperationResponse() call.

This operation makes use of encryption, if that is established before. See: EstablishEncryption(). Check encryption with IsEncryptionAvailable. This operation is allowed only once per connection (multiple calls will have ErrorCode != Ok).

OpChangeGroups ( byte groupsToRemove, byte groupsToAdd ) : bool

Operation to handle this client's interest groups (for events in room).

Note the difference between passing null and byte[0]: null won't add/remove any groups. byte[0] will add/remove all (existing) groups. First, removing groups is executed. This way, you could leave all groups and join only the ones provided.

OpCreateRoom ( string roomName, RoomOptions roomOptions, TypedLobby lobby, ExitGames.Client.Photon.Hashtable playerProperties, bool onGameServer ) : 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.

OpFindFriends ( string friendsToFind ) : bool

Request the rooms and online status for a list of friends (each client must set a unique username via OpAuthenticate).

Used on Master Server to find the rooms played by a selected list of users. Users identify themselves by using OpAuthenticate with a unique username. The list of usernames must be fetched from some other source (not provided by Photon). The server response includes 2 arrays of info (each index matching a friend from the request): ParameterCode.FindFriendsResponseOnlineList = bool[] of online states ParameterCode.FindFriendsResponseRoomIdList = string[] of room names (empty string if not in a room)

OpGetRegions ( string appId ) : bool
OpJoinLobby ( TypedLobby lobby ) : 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 ( ExitGames.Client.Photon.Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, ExitGames.Client.Photon.Hashtable playerProperties, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter ) : bool

Operation to join a random, available room. Overloads take additional player properties. This is an async request which triggers a OnOperationResponse() call. If all rooms are closed or full, the OperationResponse will have a returnCode of ErrorCode.NoRandomMatchFound. If successful, the OperationResponse contains a gameserver address and the name of some room.

OpJoinRoom ( string roomName, RoomOptions roomOptions, TypedLobby lobby, bool createIfNotExists, ExitGames.Client.Photon.Hashtable playerProperties, bool onGameServer ) : bool

LoadBalancingPeer.OpJoinRoom

OpLeaveLobby ( ) : bool

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

OpRaiseEvent ( byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions ) : bool

Send an event with custom code/type and any content to the other players in the same room.

This override explicitly uses another parameter order to not mix it up with the implementation for Hashtable only.

OpSetCustomPropertiesOfActor ( int actorNr, ExitGames.Client.Photon.Hashtable actorProperties, bool broadcast, byte channelId ) : bool
OpSetCustomPropertiesOfRoom ( ExitGames.Client.Photon.Hashtable gameProperties, bool broadcast, byte channelId ) : bool

Méthodes protégées

Méthode Description
OpSetPropertiesOfActor ( int actorNr, ExitGames.Client.Photon.Hashtable actorProperties, bool broadcast, byte channelId, ExitGames.Client.Photon.Hashtable expectedValues ) : bool
OpSetPropertiesOfRoom ( ExitGames.Client.Photon.Hashtable gameProperties, bool broadcast, byte channelId, ExitGames.Client.Photon.Hashtable expectedValues ) : bool
OpSetPropertyOfRoom ( byte propCode, object value ) : void

Method Details

LoadbalancingPeer() public méthode

public LoadbalancingPeer ( IPhotonPeerListener listener, ConnectionProtocol protocolType ) : ExitGames.Client.Photon
listener IPhotonPeerListener
protocolType ConnectionProtocol
Résultat ExitGames.Client.Photon

OpAuthenticate() public méthode

Sends this app's appId and appVersion to identify this application server side. This is an async request which triggers a OnOperationResponse() call.
This operation makes use of encryption, if that is established before. See: EstablishEncryption(). Check encryption with IsEncryptionAvailable. This operation is allowed only once per connection (multiple calls will have ErrorCode != Ok).
public OpAuthenticate ( string appId, string appVersion, AuthenticationValues authValues, string regionCode ) : bool
appId string Your application's name or ID to authenticate. This is assigned by Photon Cloud (webpage).
appVersion string The client's version (clients with differing client appVersions are separated and players don't meet).
authValues AuthenticationValues
regionCode string When authenticating for a specific region, a NameServer will forward you to that region's MasterServer.
Résultat bool

OpChangeGroups() public méthode

Operation to handle this client's interest groups (for events in room).
Note the difference between passing null and byte[0]: null won't add/remove any groups. byte[0] will add/remove all (existing) groups. First, removing groups is executed. This way, you could leave all groups and join only the ones provided.
public OpChangeGroups ( byte groupsToRemove, byte groupsToAdd ) : bool
groupsToRemove byte Groups to remove from interest. Null will not remove any. A byte[0] will remove all.
groupsToAdd byte Groups to add to interest. Null will not add any. A byte[0] will add all current.
Résultat bool

OpCreateRoom() public méthode

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 roomName, RoomOptions roomOptions, TypedLobby lobby, ExitGames.Client.Photon.Hashtable playerProperties, bool onGameServer ) : bool
roomName string
roomOptions RoomOptions
lobby TypedLobby
playerProperties ExitGames.Client.Photon.Hashtable
onGameServer bool
Résultat bool

OpFindFriends() public méthode

Request the rooms and online status for a list of friends (each client must set a unique username via OpAuthenticate).
Used on Master Server to find the rooms played by a selected list of users. Users identify themselves by using OpAuthenticate with a unique username. The list of usernames must be fetched from some other source (not provided by Photon). The server response includes 2 arrays of info (each index matching a friend from the request): ParameterCode.FindFriendsResponseOnlineList = bool[] of online states ParameterCode.FindFriendsResponseRoomIdList = string[] of room names (empty string if not in a room)
public OpFindFriends ( string friendsToFind ) : bool
friendsToFind string Array of friend's names (make sure they are unique).
Résultat bool

OpGetRegions() public méthode

public OpGetRegions ( string appId ) : bool
appId string
Résultat bool

OpJoinLobby() public méthode

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 ( TypedLobby lobby ) : bool
lobby TypedLobby
Résultat bool

OpJoinRandomRoom() public méthode

Operation to join a random, available room. Overloads take additional player properties. This is an async request which triggers a OnOperationResponse() call. If all rooms are closed or full, the OperationResponse will have a returnCode of ErrorCode.NoRandomMatchFound. If successful, the OperationResponse contains a gameserver address and the name of some room.
public OpJoinRandomRoom ( ExitGames.Client.Photon.Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, ExitGames.Client.Photon.Hashtable playerProperties, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter ) : bool
expectedCustomRoomProperties ExitGames.Client.Photon.Hashtable Optional. A room will only be joined, if it matches these custom properties (with string keys).
expectedMaxPlayers byte Filters for a particular maxplayer setting. Use 0 to accept any maxPlayer value.
playerProperties ExitGames.Client.Photon.Hashtable This player's properties (custom and well known).
matchingType MatchmakingMode Selects one of the available matchmaking algorithms. See MatchmakingMode enum for options.
typedLobby TypedLobby
sqlLobbyFilter string
Résultat bool

OpJoinRoom() public méthode

LoadBalancingPeer.OpJoinRoom
public OpJoinRoom ( string roomName, RoomOptions roomOptions, TypedLobby lobby, bool createIfNotExists, ExitGames.Client.Photon.Hashtable playerProperties, bool onGameServer ) : bool
roomName string
roomOptions RoomOptions
lobby TypedLobby
createIfNotExists bool
playerProperties ExitGames.Client.Photon.Hashtable
onGameServer bool
Résultat bool

OpLeaveLobby() public méthode

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

OpRaiseEvent() public méthode

Send an event with custom code/type and any content to the other players in the same room.
This override explicitly uses another parameter order to not mix it up with the implementation for Hashtable only.
public OpRaiseEvent ( byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions ) : bool
eventCode byte Identifies this type of event (and the content). Your game's event codes can start with 0.
customEventContent object Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).
sendReliable bool If this event has to arrive reliably (potentially repeated if it's lost).
raiseEventOptions RaiseEventOptions Contains (slightly) less often used options. If you pass null, the default options will be used.
Résultat bool

OpSetCustomPropertiesOfActor() public méthode

public OpSetCustomPropertiesOfActor ( int actorNr, ExitGames.Client.Photon.Hashtable actorProperties, bool broadcast, byte channelId ) : bool
actorNr int
actorProperties ExitGames.Client.Photon.Hashtable
broadcast bool
channelId byte
Résultat bool

OpSetCustomPropertiesOfRoom() public méthode

public OpSetCustomPropertiesOfRoom ( ExitGames.Client.Photon.Hashtable gameProperties, bool broadcast, byte channelId ) : bool
gameProperties ExitGames.Client.Photon.Hashtable
broadcast bool
channelId byte
Résultat bool

OpSetPropertiesOfActor() protected méthode

protected OpSetPropertiesOfActor ( int actorNr, ExitGames.Client.Photon.Hashtable actorProperties, bool broadcast, byte channelId, ExitGames.Client.Photon.Hashtable expectedValues ) : bool
actorNr int
actorProperties ExitGames.Client.Photon.Hashtable
broadcast bool
channelId byte
expectedValues ExitGames.Client.Photon.Hashtable
Résultat bool

OpSetPropertiesOfRoom() protected méthode

protected OpSetPropertiesOfRoom ( ExitGames.Client.Photon.Hashtable gameProperties, bool broadcast, byte channelId, ExitGames.Client.Photon.Hashtable expectedValues ) : bool
gameProperties ExitGames.Client.Photon.Hashtable
broadcast bool
channelId byte
expectedValues ExitGames.Client.Photon.Hashtable
Résultat bool

OpSetPropertyOfRoom() protected méthode

protected OpSetPropertyOfRoom ( byte propCode, object value ) : void
propCode byte
value object
Résultat void