/// A LoadbalancingPeer provides the operations and enum definitions needed to use the loadbalancing server application which is also used in Photon Cloud.
/// </summary>
/// <remarks>
/// The LoadBalancingPeer does not keep a state, instead this is done by a LoadBalancingClient.
/// Sends this app's appId and appVersion to identify this application server side.
/// This is an async request which triggers a OnOperationResponse() call.
/// </summary>
/// <remarks>
/// 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).
/// </remarks>
/// <param name="appId">Your application's name or ID to authenticate. This is assigned by Photon Cloud (webpage).</param>
/// <param name="appVersion">The client's version (clients with differing client appVersions are separated and players don't meet).</param>
/// <param name="authValues">Contains all values relevant for authentication. Even without account system (external Custom Auth), the clients are allowed to identify themselves.</param>
/// <param name="regionCode">Optional region code, if the client should connect to a specific Photon Cloud Region.</param>
/// <param name="getLobbyStatistics">Set to true on Master Server to receive "Lobby Statistics" events.</param>
/// <returns>If the operation could be sent (has to be connected).</returns>
this.Listener.DebugReturn(DebugLevel.ERROR,"Error calling OpAuthenticate! Did not work. Check log output, AuthValues and if you're connected.");
}
returnsent;
}
/// <summary>
/// Sends this app's appId and appVersion to identify this application server side.
/// This is an async request which triggers a OnOperationResponse() call.
/// </summary>
/// <remarks>
/// 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).
/// </remarks>
/// <param name="appId">Your application's name or ID to authenticate. This is assigned by Photon Cloud (webpage).</param>
/// <param name="appVersion">The client's version (clients with differing client appVersions are separated and players don't meet).</param>
/// <param name="authValues">Optional authentication values. The client can set no values or a UserId or some parameters for Custom Authentication by a server.</param>
/// <param name="regionCode">Optional region code, if the client should connect to a specific Photon Cloud Region.</param>
/// <param name="encryptionMode"></param>
/// <param name="expectedProtocol"></param>
/// <returns>If the operation could be sent (has to be connected).</returns>
returnthis.OpCustom(OperationCode.AuthenticateOnce,opParameters,true,(byte)0,false);// we don't have to encrypt, when we have a token (which is encrypted)
Debug.LogWarning("Expected protocol set to UDP, due to encryption mode DatagramEncryption. Changing protocol in PhotonServerSettings from: "+PhotonNetwork.PhotonServerSettings.Protocol);
/// <summary>(-2) The operation you called is not implemented on the server (application) you connect to. Make sure you run the fitting applications.</summary>
[Obsolete("Use InvalidOperation.")]
publicconstintInvalidOperationCode=-2;
/// <summary>(-2) The operation you called could not be executed on the server.</summary>
/// <remarks>
/// Make sure you are connected to the server you expect.
///
/// This code is used in several cases:
/// The arguments/parameters of the operation might be out of range, missing entirely or conflicting.
/// The operation you called is not implemented on the server (application). Server-side plugins affect the available operations.
/// </remarks>
publicconstintInvalidOperation=-2;
/// <summary>(-1) Something went wrong in the server. Try to reproduce and contact Exit Games.</summary>
publicconstintInternalServerError=-1;
// server - PhotonNetwork: 0x7FFF and down
// logic-level error codes start with short.max
/// <summary>(32767) Authentication failed. Possible cause: AppId is unknown to Photon (in cloud service).</summary>
publicconstintInvalidAuthentication=0x7FFF;
/// <summary>(32766) GameId (name) already in use (can't create another). Change name.</summary>
publicconstintGameIdAlreadyExists=0x7FFF-1;
/// <summary>(32765) Game is full. This rarely happens when some player joined the room before your join completed.</summary>
publicconstintGameFull=0x7FFF-2;
/// <summary>(32764) Game is closed and can't be joined. Join another game.</summary>
publicconstintGameClosed=0x7FFF-3;
[Obsolete("No longer used, cause random matchmaking is no longer a process.")]
publicconstintAlreadyMatched=0x7FFF-4;
/// <summary>(32762) Not in use currently.</summary>
publicconstintServerFull=0x7FFF-5;
/// <summary>(32761) Not in use currently.</summary>
publicconstintUserBlocked=0x7FFF-6;
/// <summary>(32760) Random matchmaking only succeeds if a room exists thats neither closed nor full. Repeat in a few seconds or create a new room.</summary>
publicconstintNoRandomMatchFound=0x7FFF-7;
/// <summary>(32758) Join can fail if the room (name) is not existing (anymore). This can happen when players leave while you join.</summary>
publicconstintGameDoesNotExist=0x7FFF-9;
/// <summary>(32757) Authorization on the Photon Cloud failed becaus the concurrent users (CCU) limit of the app's subscription is reached.</summary>
/// <remarks>
/// Unless you have a plan with "CCU Burst", clients might fail the authentication step during connect.
/// Affected client are unable to call operations. Please note that players who end a game and return
/// to the master server will disconnect and re-connect, which means that they just played and are rejected
/// in the next minute / re-connect.
/// This is a temporary measure. Once the CCU is below the limit, players will be able to connect an play again.
///
/// OpAuthorize is part of connection workflow but only on the Photon Cloud, this error can happen.
/// Self-hosted Photon servers with a CCU limited license won't let a client connect at all.
/// </remarks>
publicconstintMaxCcuReached=0x7FFF-10;
/// <summary>(32756) Authorization on the Photon Cloud failed because the app's subscription does not allow to use a particular region's server.</summary>
/// <remarks>
/// Some subscription plans for the Photon Cloud are region-bound. Servers of other regions can't be used then.
/// Check your master server address and compare it with your Photon Cloud Dashboard's info.
/// https://cloud.photonengine.com/dashboard
///
/// OpAuthorize is part of connection workflow but only on the Photon Cloud, this error can happen.
/// Self-hosted Photon servers with a CCU limited license won't let a client connect at all.
/// </remarks>
publicconstintInvalidRegion=0x7FFF-11;
/// <summary>
/// (32755) Custom Authentication of the user failed due to setup reasons (see Cloud Dashboard) or the provided user data (like username or token). Check error message for details.
/// Class for constants. These (byte) values define "well known" properties for an Actor / Player.
/// Pun uses these constants internally.
/// </summary>
/// <remarks>
/// "Custom properties" have to use a string-type as key. They can be assigned at will.
/// </remarks>
publicclassActorProperties
{
/// <summary>(255) Name of a player/actor.</summary>
publicconstbytePlayerName=255;// was: 1
/// <summary>(254) Tells you if the player is currently in this game (getting events live).</summary>
/// <remarks>A server-set value for async games, where players can leave the game and return later.</remarks>
publicconstbyteIsInactive=254;
/// <summary>(253) UserId of the player. Sent when room gets created with RoomOptions.PublishUserId = true.</summary>
publicconstbyteUserId=253;
}
/// <summary>
/// Class for constants. These (byte) values are for "well known" room/game properties used in Photon Loadbalancing.
/// Pun uses these constants internally.
/// </summary>
/// <remarks>
/// "Custom properties" have to use a string-type as key. They can be assigned at will.
/// </remarks>
publicclassGamePropertyKey
{
/// <summary>(255) Max number of players that "fit" into this room. 0 is for "unlimited".</summary>
publicconstbyteMaxPlayers=255;
/// <summary>(254) Makes this room listed or not in the lobby on master.</summary>
publicconstbyteIsVisible=254;
/// <summary>(253) Allows more players to join a room (or not).</summary>
publicconstbyteIsOpen=253;
/// <summary>(252) Current count of players in the room. Used only in the lobby on master.</summary>
publicconstbytePlayerCount=252;
/// <summary>(251) True if the room is to be removed from room listing (used in update to room list in lobby on master)</summary>
publicconstbyteRemoved=251;
/// <summary>(250) A list of the room properties to pass to the RoomInfo list in a lobby. This is used in CreateRoom, which defines this list once per room.</summary>
publicconstbytePropsListedInLobby=250;
/// <summary>(249) Equivalent of Operation Join parameter CleanupCacheOnLeave.</summary>
publicconstbyteCleanupCacheOnLeave=249;
/// <summary>(248) Code for MasterClientId, which is synced by server. When sent as op-parameter this is (byte)203. As room property this is (byte)248.</summary>
/// <remarks>Tightly related to ParameterCode.MasterClientId.</remarks>
publicconstbyteMasterClientId=(byte)248;
/// <summary>(247) Code for ExpectedUsers in a room. Matchmaking keeps a slot open for the players with these userIDs.</summary>
publicconstbyteExpectedUsers=(byte)247;
}
/// <summary>
/// Class for constants. These values are for events defined by Photon Loadbalancing.
/// Pun uses these constants internally.
/// </summary>
/// <remarks>They start at 255 and go DOWN. Your own in-game events can start at 0.</remarks>
publicclassEventCode
{
/// <summary>(230) Initial list of RoomInfos (in lobby on Master)</summary>
publicconstbyteGameList=230;
/// <summary>(229) Update of RoomInfos to be merged into "initial" list (in lobby on Master)</summary>
publicconstbyteGameListUpdate=229;
/// <summary>(228) Currently not used. State of queueing in case of server-full</summary>
publicconstbyteQueueState=228;
/// <summary>(227) Currently not used. Event for matchmaking</summary>
publicconstbyteMatch=227;
/// <summary>(226) Event with stats about this application (players, rooms, etc)</summary>
publicconstbyteAppStats=226;
/// <summary>(224) This event provides a list of lobbies with their player and game counts.</summary>
publicconstbyteLobbyStats=224;
/// <summary>(210) Internally used in case of hosting by Azure</summary>
[Obsolete("TCP routing was removed after becoming obsolete.")]
publicconstbyteAzureNodeInfo=210;
/// <summary>(255) Event Join: someone joined the game. The new actorNumber is provided as well as the properties of that actor (if set in OpJoin).</summary>
publicconstbyteJoin=(byte)255;
/// <summary>(254) Event Leave: The player who left the game can be identified by the actorNumber.</summary>
publicconstbyteLeave=(byte)254;
/// <summary>(253) When you call OpSetProperties with the broadcast option "on", this event is fired. It contains the properties being set.</summary>
publicconstbytePropertiesChanged=(byte)253;
/// <summary>(253) When you call OpSetProperties with the broadcast option "on", this event is fired. It contains the properties being set.</summary>
[Obsolete("Use PropertiesChanged now.")]
publicconstbyteSetProperties=(byte)253;
/// <summary>(252) When player left game unexpected and the room has a playerTtl > 0, this event is fired to let everyone know about the timeout.</summary>
/// Obsolete. Replaced by Leave. public const byte Disconnect = LiteEventCode.Disconnect;
/// <summary>(251) Sent by Photon Cloud when a plugin-call or webhook-call failed. Usually, the execution on the server continues, despite the issue. Contains: ParameterCode.Info.</summary>
/// <summary>(250) Sent by Photon whent he event cache slice was changed. Done by OpRaiseEvent.</summary>
publicconstbyteCacheSliceChanged=250;
/// <summary>(223) Sent by Photon to update a token before it times out.</summary>
publicconstbyteAuthEvent=223;
}
/// <summary>
/// Class for constants. Codes for parameters of Operations and Events.
/// Pun uses these constants internally.
/// </summary>
publicclassParameterCode
{
/// <summary>(237) A bool parameter for creating games. If set to true, no room events are sent to the clients on join and leave. Default: false (and not sent).</summary>
publicconstbyteSuppressRoomEvents=237;
/// <summary>(236) Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds.</summary>
publicconstbyteEmptyRoomTTL=236;
/// <summary>(235) Time To Live (TTL) for an 'actor' in a room. If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds.</summary>
publicconstbytePlayerTTL=235;
/// <summary>(234) Optional parameter of OpRaiseEvent and OpSetCustomProperties to forward the event/operation to a web-service.</summary>
publicconstbyteEventForward=234;
/// <summary>(233) Optional parameter of OpLeave in async games. If false, the player does abandons the game (forever). By default players become inactive and can re-join.</summary>
[Obsolete("Use: IsInactive")]
publicconstbyteIsComingBack=(byte)233;
/// <summary>(233) Used in EvLeave to describe if a user is inactive (and might come back) or not. In rooms with PlayerTTL, becoming inactive is the default case.</summary>
publicconstbyteIsInactive=(byte)233;
/// <summary>(232) Used when creating rooms to define if any userid can join the room only once.</summary>
publicconstbyteCheckUserOnJoin=(byte)232;
/// <summary>(231) Code for "Check And Swap" (CAS) when changing properties.</summary>
publicconstbyteExpectedValues=(byte)231;
/// <summary>(230) Address of a (game) server to use.</summary>
publicconstbyteAddress=230;
/// <summary>(229) Count of players in this application in a rooms (used in stats event)</summary>
publicconstbytePeerCount=229;
/// <summary>(228) Count of games in this application (used in stats event)</summary>
publicconstbyteGameCount=228;
/// <summary>(227) Count of players on the master server (in this app, looking for rooms)</summary>
publicconstbyteMasterPeerCount=227;
/// <summary>(225) User's ID</summary>
publicconstbyteUserId=225;
/// <summary>(224) Your application's ID: a name on your own Photon or a GUID on the Photon Cloud</summary>
publicconstbyteApplicationId=224;
/// <summary>(223) Not used currently (as "Position"). If you get queued before connect, this is your position</summary>
publicconstbytePosition=223;
/// <summary>(223) Modifies the matchmaking algorithm used for OpJoinRandom. Allowed parameter values are defined in enum MatchmakingMode.</summary>
publicconstbyteMatchMakingType=223;
/// <summary>(222) List of RoomInfos about open / listed rooms</summary>
publicconstbyteGameList=222;
/// <summary>(221) Internally used to establish encryption</summary>
publicconstbyteSecret=221;
/// <summary>(220) Version of your application</summary>
publicconstbyteAppVersion=220;
/// <summary>(210) Internally used in case of hosting by Azure</summary>
[Obsolete("TCP routing was removed after becoming obsolete.")]
publicconstbyteAzureNodeInfo=210;// only used within events, so use: EventCode.AzureNodeInfo
/// <summary>(209) Internally used in case of hosting by Azure</summary>
[Obsolete("TCP routing was removed after becoming obsolete.")]
publicconstbyteAzureLocalNodeId=209;
/// <summary>(208) Internally used in case of hosting by Azure</summary>
[Obsolete("TCP routing was removed after becoming obsolete.")]
publicconstbyteAzureMasterNodeId=208;
/// <summary>(255) Code for the gameId/roomName (a unique name per room). Used in OpJoin and similar.</summary>
publicconstbyteRoomName=(byte)255;
/// <summary>(250) Code for broadcast parameter of OpSetProperties method.</summary>
publicconstbyteBroadcast=(byte)250;
/// <summary>(252) Code for list of players in a room. Currently not used.</summary>
publicconstbyteActorList=(byte)252;
/// <summary>(254) Code of the Actor of an operation. Used for property get and set.</summary>
publicconstbyteActorNr=(byte)254;
/// <summary>(249) Code for property set (Hashtable).</summary>
publicconstbytePlayerProperties=(byte)249;
/// <summary>(245) Code of data/custom content of an event. Used in OpRaiseEvent.</summary>
publicconstbyteCustomEventContent=(byte)245;
/// <summary>(245) Code of data of an event. Used in OpRaiseEvent.</summary>
publicconstbyteData=(byte)245;
/// <summary>(244) Code used when sending some code-related parameter, like OpRaiseEvent's event-code.</summary>
/// <remarks>This is not the same as the Operation's code, which is no longer sent as part of the parameter Dictionary in Photon 3.</remarks>
publicconstbyteCode=(byte)244;
/// <summary>(248) Code for property set (Hashtable).</summary>
publicconstbyteGameProperties=(byte)248;
/// <summary>
/// (251) Code for property-set (Hashtable). This key is used when sending only one set of properties.
/// If either ActorProperties or GameProperties are used (or both), check those keys.
/// </summary>
publicconstbyteProperties=(byte)251;
/// <summary>(253) Code of the target Actor of an operation. Used for property set. Is 0 for game</summary>
publicconstbyteTargetActorNr=(byte)253;
/// <summary>(246) Code to select the receivers of events (used in Lite, Operation RaiseEvent).</summary>
publicconstbyteReceiverGroup=(byte)246;
/// <summary>(247) Code for caching events while raising them.</summary>
publicconstbyteCache=(byte)247;
/// <summary>(241) Bool parameter of CreateRoom Operation. If true, server cleans up roomcache of leaving players (their cached events get removed).</summary>
publicconstbyteCleanupCacheOnLeave=(byte)241;
/// <summary>(240) Code for "group" operation-parameter (as used in Op RaiseEvent).</summary>
publicconstbyteGroup=240;
/// <summary>(239) The "Remove" operation-parameter can be used to remove something from a list. E.g. remove groups from player's interest groups.</summary>
publicconstbyteRemove=239;
/// <summary>(239) Used in Op Join to define if UserIds of the players are broadcast in the room. Useful for FindFriends and reserving slots for expected users.</summary>
publicconstbytePublishUserId=239;
/// <summary>(238) The "Add" operation-parameter can be used to add something to some list or set. E.g. add groups to player's interest groups.</summary>
publicconstbyteAdd=238;
/// <summary>(218) Content for EventCode.ErrorInfo and internal debug operations.</summary>
publicconstbyteInfo=218;
/// <summary>(217) This key's (byte) value defines the target custom authentication type/service the client connects with. Used in OpAuthenticate</summary>
publicconstbyteClientAuthenticationType=217;
/// <summary>(216) This key's (string) value provides parameters sent to the custom authentication type/service the client connects with. Used in OpAuthenticate</summary>
publicconstbyteClientAuthenticationParams=216;
/// <summary>(215) Makes the server create a room if it doesn't exist. OpJoin uses this to always enter a room, unless it exists and is full/closed.</summary>
// public const byte CreateIfNotExists = 215;
/// <summary>(215) The JoinMode enum defines which variant of joining a room will be executed: Join only if available, create if not exists or re-join.</summary>
/// <remarks>Replaces CreateIfNotExists which was only a bool-value.</remarks>
publicconstbyteJoinMode=215;
/// <summary>(214) This key's (string or byte[]) value provides parameters sent to the custom authentication service setup in Photon Dashboard. Used in OpAuthenticate</summary>
publicconstbyteClientAuthenticationData=214;
/// <summary>(203) Code for MasterClientId, which is synced by server. When sent as op-parameter this is code 203.</summary>
/// <remarks>Tightly related to GamePropertyKey.MasterClientId.</remarks>
publicconstbyteMasterClientId=(byte)203;
/// <summary>(1) Used in Op FindFriends request. Value must be string[] of friends to look up.</summary>
publicconstbyteFindFriendsRequestList=(byte)1;
/// <summary>(1) Used in Op FindFriends response. Contains bool[] list of online states (false if not online).</summary>
/// <summary>(213) Used in matchmaking-related methods and when creating a room to name a lobby (to join or to attach a room to).</summary>
publicconstbyteLobbyName=(byte)213;
/// <summary>(212) Used in matchmaking-related methods and when creating a room to define the type of a lobby. Combined with the lobby name this identifies the lobby.</summary>
publicconstbyteLobbyType=(byte)212;
/// <summary>(211) This (optional) parameter can be sent in Op Authenticate to turn on Lobby Stats (info about lobby names and their user- and game-counts). See: PhotonNetwork.Lobbies</summary>
publicconstbyteLobbyStats=(byte)211;
/// <summary>(210) Used for region values in OpAuth and OpGetRegions.</summary>
publicconstbyteRegion=(byte)210;
/// <summary>(209) Path of the WebRPC that got called. Also known as "WebRpc Name". Type: string.</summary>
publicconstbyteUriPath=209;
/// <summary>(208) Parameters for a WebRPC as: Dictionary<string, object>. This will get serialized to JSon.</summary>
publicconstbyteWebRpcParameters=208;
/// <summary>(207) ReturnCode for the WebRPC, as sent by the web service (not by Photon, which uses ErrorCode). Type: byte.</summary>
publicconstbyteWebRpcReturnCode=207;
/// <summary>(206) Message returned by WebRPC server. Analog to Photon's debug message. Type: string.</summary>
publicconstbyteWebRpcReturnMessage=206;
/// <summary>(205) Used to define a "slice" for cached events. Slices can easily be removed from cache. Type: int.</summary>
publicconstbyteCacheSliceIndex=205;
/// <summary>(204) Informs the server of the expected plugin setup.</summary>
/// <remarks>
/// The operation will fail in case of a plugin mismatch returning error code PluginMismatch 32751(0x7FFF - 16).
/// Setting string[]{} means the client expects no plugin to be setup.
/// Note: for backwards compatibility null omits any check.
/// </remarks>
publicconstbytePlugins=204;
/// <summary>(202) Used by the server in Operation Responses, when it sends the nickname of the client (the user's nickname).</summary>
publicconstbyteNickName=202;
/// <summary>(201) Informs user about name of plugin load to game</summary>
publicconstbytePluginName=201;
/// <summary>(200) Informs user about version of plugin load to game</summary>
publicconstbytePluginVersion=200;
/// <summary>(195) Protocol which will be used by client to connect master/game servers. Used for nameserver.</summary>
publicconstbyteExpectedProtocol=195;
/// <summary>(194) Set of custom parameters which are sent in auth request.</summary>
publicconstbyteCustomInitData=194;
/// <summary>(193) How are we going to encrypt data.</summary>
publicconstbyteEncryptionMode=193;
/// <summary>(192) Parameter of Authentication, which contains encryption keys (depends on AuthMode and EncryptionMode).</summary>
publicconstbyteEncryptionData=192;
}
/// <summary>
/// Class for constants. Contains operation codes.
/// Pun uses these constants internally.
/// </summary>
publicclassOperationCode
{
[Obsolete("Exchanging encrpytion keys is done internally in the lib now. Don't expect this operation-result.")]
publicconstbyteExchangeKeysForEncryption=250;
/// <summary>(255) Code for OpJoin, to get into a room.</summary>
publicconstbyteJoin=255;
/// <summary>(231) Authenticates this peer and connects to a virtual application</summary>
publicconstbyteAuthenticateOnce=231;
/// <summary>(230) Authenticates this peer and connects to a virtual application</summary>
publicconstbyteAuthenticate=230;
/// <summary>(229) Joins lobby (on master)</summary>
publicconstbyteJoinLobby=229;
/// <summary>(228) Leaves lobby (on master)</summary>
publicconstbyteLeaveLobby=228;
/// <summary>(227) Creates a game (or fails if name exists)</summary>
publicconstbyteCreateGame=227;
/// <summary>(226) Join game (by name)</summary>
publicconstbyteJoinGame=226;
/// <summary>(225) Joins random game (on master)</summary>
publicconstbyteJoinRandomGame=225;
// public const byte CancelJoinRandom = 224; // obsolete, cause JoinRandom no longer is a "process". now provides result immediately
/// <summary>(254) Code for OpLeave, to get out of a room.</summary>
publicconstbyteLeave=(byte)254;
/// <summary>(253) Raise event (in a room, for other actors/players)</summary>
publicconstbyteRaiseEvent=(byte)253;
/// <summary>(252) Set Properties (of room or actor/player)</summary>
publicconstbyteSetProperties=(byte)252;
/// <summary>(251) Get Properties</summary>
publicconstbyteGetProperties=(byte)251;
/// <summary>(248) Operation code to change interest groups in Rooms (Lite application and extending ones).</summary>
publicconstbyteChangeGroups=(byte)248;
/// <summary>(222) Request the rooms and online status for a list of friends (by name, which should be unique).</summary>
publicconstbyteFindFriends=222;
/// <summary>(221) Request statistics about a specific list of lobbies (their user and game count).</summary>
publicconstbyteGetLobbyStats=221;
/// <summary>(220) Get list of regional servers from a NameServer.</summary>
publicconstbyteGetRegions=220;
/// <summary>(219) WebRpc Operation.</summary>
publicconstbyteWebRpc=219;
/// <summary>(218) Operation to set some server settings. Used with different parameters on various servers.</summary>
publicconstbyteServerSettings=218;
}
/// <summary>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.</summary>
/// <remarks>These values are not directly used by a game but implicitly set.</remarks>
publicenumJoinMode:byte
{
/// <summary>Regular join. The room must exist.</summary>
Default=0,
/// <summary>Join or create the room if it's not existing. Used for OpJoinOrCreate for example.</summary>
CreateIfNotExists=1,
/// <summary>The room might be out of memory and should be loaded (if possible) from a Turnbased web-service.</summary>
JoinOrRejoin=2,
/// <summary>Only re-join will be allowed. If the user is not yet in the room, this will fail.</summary>
RejoinOnly=3,
}
/// <summary>
/// Options for matchmaking rules for OpJoinRandom.
/// </summary>
publicenumMatchmakingMode:byte
{
/// <summary>Fills up rooms (oldest first) to get players together as fast as possible. Default.</summary>
/// <remarks>Makes most sense with MaxPlayers > 0 and games that can only start with more players.</remarks>
FillRoom=0,
/// <summary>Distributes players across available rooms sequentially but takes filter into account. Without filter, rooms get players evenly distributed.</summary>
SerialMatching=1,
/// <summary>Joins a (fully) random room. Expected properties must match but aside from this, any available room might be selected.</summary>
RandomMatching=2
}
/// <summary>
/// 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.
/// </summary>
publicenumReceiverGroup:byte
{
/// <summary>Default value (not sent). Anyone else gets my event.</summary>
Others=0,
/// <summary>Everyone in the current room (including this peer) will get this event.</summary>
All=1,
/// <summary>The server sends this event only to the actor with the lowest actorNumber.</summary>
/// <remarks>The "master client" does not have special rights but is the one who is in this room the longest time.</remarks>
MasterClient=2,
}
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// Caching works only combination with ReceiverGroup options Others and All.
/// </remarks>
publicenumEventCaching:byte
{
/// <summary>Default value (not sent).</summary>
DoNotCache=0,
/// <summary>Will merge this event's keys with those already cached.</summary>
[Obsolete]
MergeCache=1,
/// <summary>Replaces the event cache for this eventCode with this event's content.</summary>
[Obsolete]
ReplaceCache=2,
/// <summary>Removes this event (by eventCode) from the cache.</summary>
[Obsolete]
RemoveCache=3,
/// <summary>Adds an event to the room's cache</summary>
AddToRoomCache=4,
/// <summary>Adds this event to the cache for actor 0 (becoming a "globally owned" event in the cache).</summary>
AddToRoomCacheGlobal=5,
/// <summary>Remove fitting event from the room's cache.</summary>
RemoveFromRoomCache=6,
/// <summary>Removes events of players who already left the room (cleaning up).</summary>
RemoveFromRoomCacheForActorsLeft=7,
/// <summary>Increase the index of the sliced cache.</summary>
SliceIncreaseIndex=10,
/// <summary>Set the index of the sliced cache. You must set RaiseEventOptions.CacheSliceIndex for this.</summary>
SliceSetIndex=11,
/// <summary>Purge cache slice with index. Exactly one slice is removed from cache. You must set RaiseEventOptions.CacheSliceIndex for this.</summary>
SlicePurgeIndex=12,
/// <summary>Purge cache slices with specified index and anything lower than that. You must set RaiseEventOptions.CacheSliceIndex for this.</summary>
SlicePurgeUpToIndex=13,
}
/// <summary>
/// Flags for "types of properties", being used as filter in OpGetProperties.
/// </summary>
[Flags]
publicenumPropertyTypeFlag:byte
{
/// <summary>(0x00) Flag type for no property type.</summary>
None=0x00,
/// <summary>(0x01) Flag type for game-attached properties.</summary>
Game=0x01,
/// <summary>(0x02) Flag type for actor related propeties.</summary>
Actor=0x02,
/// <summary>(0x01) Flag type for game AND actor properties. Equal to 'Game'</summary>
GameAndActor=Game|Actor
}
/// <summary>Wraps up common room properties needed when you create rooms. Read the individual entries for more details.</summary>
/// <remarks>This directly maps to the fields in the Room class.</remarks>
publicclassRoomOptions
{
/// <summary>Defines if this room is listed in the lobby. If not, it also is not joined randomly.</summary>
/// <remarks>
/// A room that is not visible will be excluded from the room lists that are sent to the clients in lobbies.
/// An invisible room can be joined by name but is excluded from random matchmaking.
///
/// Use this to "hide" a room and simulate "private rooms". Players can exchange a roomname and create it
/// <summary>Max number of players that can be in the room at any time. 0 means "no limit".</summary>
publicbyteMaxPlayers;
/// <summary>Time To Live (TTL) for an 'actor' in a room. If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds.</summary>
publicintPlayerTtl;
/// <summary>Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds.</summary>
publicintEmptyRoomTtl;
///// <summary>Activates UserId checks on joining - allowing a users to be only once in the room.</summary>
///// <remarks>
///// Turnbased rooms should be created with this check turned on! They should also use custom authentication.
///// Disabled by default for backwards-compatibility.
///// </remarks>
//public bool CheckUserOnJoin { get { return this.checkUserOnJoinField; } set { this.checkUserOnJoinField = value; } }
//private bool checkUserOnJoinField = false;
/// <summary>Removes a user's events and properties from the room when a user leaves.</summary>
/// <remarks>
/// This makes sense when in rooms where players can't place items in the room and just vanish entirely.
/// When you disable this, the event history can become too long to load if the room stays in use indefinitely.
/// Default: true. Cleans up the cache and props of leaving users.
/// <summary>Defines if the server should simply send the event, put it in the cache or remove events that are like this one.</summary>
/// <remarks>
/// When using option: SliceSetIndex, SlicePurgeIndex or SlicePurgeUpToIndex, set a CacheSliceIndex. All other options except SequenceChannel get ignored.
/// </remarks>
publicEventCachingCachingOption;
/// <summary>The number of the Interest Group to send this to. 0 goes to all users but to get 1 and up, clients must subscribe to the group first.</summary>
publicbyteInterestGroup;
/// <summary>A list of PhotonPlayer.IDs to send this event to. You can implement events that just go to specific users this way.</summary>
publicint[]TargetActors;
/// <summary>Sends the event to All, MasterClient or Others (default). Be careful with MasterClient, as the client might disconnect before it got the event and it gets lost.</summary>
publicReceiverGroupReceivers;
/// <summary>Events are ordered per "channel". If you have events that are independent of others, they can go into another sequence or channel.</summary>
publicbyteSequenceChannel;
/// <summary>Events can be forwarded to Webhooks, which can evaluate and use the events to follow the game's state.</summary>
publicboolForwardToWebhook;
///// <summary>Used along with CachingOption SliceSetIndex, SlicePurgeIndex or SlicePurgeUpToIndex if you want to set or purge a specific cache-slice.</summary>
//public int CacheSliceIndex;
publicboolEncrypt;
}
/// <summary>
/// Options of lobby types available. Lobby types might be implemented in certain Photon versions and won't be available on older servers.
/// </summary>
publicenumLobbyType:byte
{
/// <summary>This lobby is used unless another is defined by game or JoinRandom. Room-lists will be sent and JoinRandomRoom can filter by matching properties.</summary>
Default=0,
/// <summary>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.</summary>
SqlLobby=2,
/// <summary>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.</summary>
AsyncRandomLobby=3
}
/// <summary>Refers to a specific lobby (and type) on the server.</summary>
/// <remarks>
/// The name and type are the unique identifier for a lobby.<br/>
/// Join a lobby via PhotonNetwork.JoinLobby(TypedLobby lobby).<br/>
/// The current lobby is stored in PhotonNetwork.lobby.
/// </remarks>
publicclassTypedLobby
{
/// <summary>Name of the lobby this game gets added to. Default: null, attached to default lobby. Lobbies are unique per lobbyName plus lobbyType, so the same name can be used when several types are existing.</summary>
publicstringName;
/// <summary>Type of the (named)lobby this game gets added to</summary>
/// Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon.
/// </summary>
publicenumCustomAuthenticationType:byte
{
/// <summary>Use a custom authentification service. Currently the only implemented option.</summary>
Custom=0,
/// <summary>Authenticates users by their Steam Account. Set auth values accordingly!</summary>
Steam=1,
/// <summary>Authenticates users by their Facebook Account. Set auth values accordingly!</summary>
Facebook=2,
/// <summary>Authenticates users by their Oculus Account and token.</summary>
Oculus=3,
/// <summary>Authenticates users by their PSN Account and token.</summary>
PlayStation=4,
/// <summary>Authenticates users by their Xbox Account and XSTS token.</summary>
Xbox=5,
/// <summary>Disables custom authentification. Same as not providing any AuthenticationValues for connect (more precisely for: OpAuthenticate).</summary>
None=byte.MaxValue
}
/// <summary>
/// Container for user authentication in Photon. Set AuthValues before you connect - all else is handled.
/// </summary>
/// <remarks>
/// On Photon, user authentication is optional but can be useful in many cases.
/// If you want to FindFriends, a unique ID per user is very practical.
///
/// There are basically three options for user authentification: None at all, the client sets some UserId
/// or you can use some account web-service to authenticate a user (and set the UserId server-side).
///
/// Custom Authentication lets you verify end-users by some kind of login or token. It sends those
/// values to Photon which will verify them before granting access or disconnecting the client.
///
/// The AuthValues are sent in OpAuthenticate when you connect, so they must be set before you connect.
/// Should you not set any AuthValues, PUN will create them and set the playerName as userId in them.
/// If the AuthValues.userId is null or empty when it's sent to the server, then the Photon Server assigns a userId!
///
/// The Photon Cloud Dashboard will let you enable this feature and set important server values for it.
/// <summary>The type of custom authentication provider that should be used. Currently only "Custom" or "None" (turns this off).</summary>
publicCustomAuthenticationTypeAuthType
{
get{returnauthType;}
set{authType=value;}
}
/// <summary>This string must contain any (http get) parameters expected by the used authentication service. By default, username and token.</summary>
/// <remarks>Standard http get parameters are used here and passed on to the service that's defined in the server (Photon Cloud Dashboard).</remarks>
publicstringAuthGetParameters{get;set;}
/// <summary>Data to be passed-on to the auth service via POST. Default: null (not sent). Either string or byte[] (see setters).</summary>
publicobjectAuthPostData{get;privateset;}
/// <summary>After initial authentication, Photon provides a token for this client / user, which is subsequently used as (cached) validation.</summary>
publicstringToken{get;set;}
/// <summary>The UserId should be a unique identifier per user. This is for finding friends, etc..</summary>
/// <remarks>See remarks of AuthValues for info about how this is set and used.</remarks>
publicstringUserId{get;set;}
/// <summary>Creates empty auth values without any info.</summary>
publicAuthenticationValues()
{
}
/// <summary>Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType.</summary>
/// <param name="userId">Some UserId to set in Photon.</param>
publicAuthenticationValues(stringuserId)
{
this.UserId=userId;
}
/// <summary>Sets the data to be passed-on to the auth service via POST.</summary>
/// <param name="stringData">String data to be used in the body of the POST request. Null or empty string will set AuthPostData to null.</param>