Namespace: Constants

Photon.LoadBalancing. Constants

Photon Load Balancing API Constants
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1267


<static, readonly> CustomAuthenticationType

Options for optional "Custom Authentication" services used with Photon.

Name Type Description
Custom number Default. Use a custom authentification service.
Steam number Authenticates users by their Steam Account. Set auth values accordingly.
Facebook number Authenticates users by their Facebook Account. Set auth values accordingly.
None number Disables custom authentification.
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1666

<static, readonly> ErrorCode

Master and Game servers error codes.

Name Type Description
Ok number No Error.
OperationNotAllowedInCurrentState number Operation can't be executed yet.
InvalidOperationCode number The operation you called is not implemented on the server (application) you connect to. Make sure you run the fitting applications.
InternalServerError number Something went wrong in the server. Try to reproduce and contact Exit Games.
InvalidAuthentication number Authentication failed. Possible cause: AppId is unknown to Photon (in cloud service).
GameIdAlreadyExists number GameId (name) already in use (can't create another). Change name.
GameFull number Game is full. This can when players took over while you joined the game.
GameClosed number Game is closed and can't be joined. Join another game.
NoRandomMatchFound number Random matchmaking only succeeds if a room exists thats neither closed nor full. Repeat in a few seconds or create a new room.
GameDoesNotExist number Join can fail if the room (name) is not existing (anymore). This can happen when players leave while you join.
MaxCcuReached number Authorization on the Photon Cloud failed becaus the concurrent users (CCU) limit of the app's subscription is reached.
InvalidRegion number Authorization on the Photon Cloud failed because the app's subscription does not allow to use a particular region's server.
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1280

<static, readonly> EventCaching

Caching options for events.

Name Type Description
DoNotCache number Default. Do not cache.
MergeCache number Will merge this event's keys with those already cached.
ReplaceCache number Replaces the event cache for this eventCode with this event's content.
RemoveCache number Removes this event (by eventCode) from the cache.
AddToRoomCache number Adds an event to the room's cache.
AddToRoomCacheGlobal number Adds this event to the cache for actor 0 (becoming a "globally owned" event in the cache).
RemoveFromRoomCache number Remove fitting event from the room's cache.
RemoveFromRoomCacheForActorsLeft number Removes events of players who already left the room (cleaning up).
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1594

<static, readonly> LobbyType

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

Name Type Description
Default number 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 number 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.
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1681

<static, readonly> MatchmakingMode

Options for matchmaking rules for joinRandomGame.

Name Type Description
FillRoom number Default. FillRoom Fills up rooms (oldest first) to get players together as fast as possible. Makes most sense with MaxPlayers > 0 and games that can only start with more players.
SerialMatching number Distributes players across available rooms sequentially but takes filter into account. Without filter, rooms get players evenly distributed.
RandomMatching number Joins a (fully) random room. Expected properties must match but aside from this, any available room might be selected.
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1577

<static, readonly> OperationCode

Codes for parameters and events used in Photon Load Balancing API.

Name Type Description
Authenticate number Authenticates this peer and connects to a virtual application.
JoinLobby number Joins lobby (on Master).
LeaveLobby number Leaves lobby (on Master).
CreateGame number Creates a game (or fails if name exists).
JoinGame number Joins room (by name).
JoinRandomGame number Joins random room (on Master).
Leave number Leaves the room.
RaiseEvent number Raises event (in a room, for other actors/players).
SetProperties number Sets Properties (of room or actor/player).
GetProperties number Gets Properties.
ChangeGroups number Changes interest groups in room.
FindFriends number Requests Master server for actors online status and joined rooms.
LobbyStats number Requests Master server for lobbies statistics.
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1527

<static, readonly> ReceiverGroup

Options for choosing room's actors who should receive events.

Name Type Description
Others number Default. Anyone else gets my event.
All number Everyone in the current room (including this peer) will get this event.
MasterClient number The "master client" does not have special rights but is the one who is in this room the longest time.
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1641