Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
Peer Class Reference
Inheritance diagram for Peer:
Inheritance graph
[legend]
Collaboration diagram for Peer:
Collaboration graph
[legend]

Public Member Functions

 Peer (Photon::PhotonListener &listener, nByte connectionProtocol=Photon::ConnectionProtocol::DEFAULT, nByte serializationProtocol=Common::SerializationProtocol::DEFAULT)
 
virtual void disconnect (void)
 
virtual bool opJoinLobby (const Common::JString &lobbyName=Common::JString(), nByte lobbyType=LobbyType::DEFAULT)
 
virtual bool opLeaveLobby (void)
 
virtual bool opCreateRoom (const Common::JString &gameID=Common::JString(), const RoomOptions &options=RoomOptions(), const Common::Hashtable &customLocalPlayerProperties=Common::Hashtable(), const Common::JVector< Common::JString > &expectedUsers=Common::JVector< Common::JString >())
 
virtual bool opJoinRoom (const Common::JString &gameID, const RoomOptions &options=RoomOptions(), const Common::Hashtable &customLocalPlayerProperties=Common::Hashtable(), bool createIfNotExists=false, bool rejoin=false, int cacheSliceIndex=0, const Common::JVector< Common::JString > &expectedUsers=Common::JVector< Common::JString >())
 
virtual bool opJoinRandomRoom (const Common::JString &gameID=Common::JString(), const RoomOptions &options=RoomOptions(), bool createIfNotExists=false, const Common::Hashtable &customRoomProperties=Common::Hashtable(), nByte maxPlayers=0, nByte matchmakingMode=MatchmakingMode::FILL_ROOM, const Common::JString &lobbyName=Common::JString(), nByte lobbyType=LobbyType::DEFAULT, const Common::JString &sqlLobbyFilter=Common::JString(), const Common::JVector< Common::JString > &expectedUsers=Common::JVector< Common::JString >())
 
virtual bool opLeaveRoom (bool willComeBack=false, bool sendAuthCookie=false)
 
template<typename Ftype >
bool opRaiseEvent (bool reliable, const Ftype &parameters, nByte eventCode, const RaiseEventOptions &options=RaiseEventOptions())
 
template<typename Ftype >
bool opRaiseEvent (bool reliable, const Ftype pParameterArray, int arrSize, nByte eventCode, const RaiseEventOptions &options=RaiseEventOptions())
 
template<typename Ftype >
bool opRaiseEvent (bool reliable, const Ftype pParameterArray, const int *pArrSizes, nByte eventCode, const RaiseEventOptions &options=RaiseEventOptions())
 
virtual bool opAuthenticate (const Common::JString &appID, const Common::JString &appVersion, bool encrypted, const AuthenticationValues &authenticationValues=AuthenticationValues(), bool lobbyStats=false, const Common::JString &regionCode=Common::JString())
 
virtual bool opAuthenticateOnce (const Common::JString &appID, const Common::JString &appVersion, nByte connectionProtocol, nByte encryptionMode, const AuthenticationValues &authenticationValues=AuthenticationValues(), bool lobbyStats=false, const Common::JString &regionCode=Common::JString())
 
virtual bool opFindFriends (const Common::JString *friendsToFind, short numFriendsToFind)
 
virtual bool opLobbyStats (const Common::JVector< LoadBalancing::LobbyStatsRequest > &lobbiesToQuery=Common::JVector< LoadBalancing::LobbyStatsRequest >())
 
virtual bool opChangeGroups (const Common::JVector< nByte > *pGroupsToRemove, const Common::JVector< nByte > *pGroupsToAdd)
 
virtual bool opWebRpc (const Common::JString &uriPath)
 
template<typename Ftype >
bool opWebRpc (const Common::JString &uriPath, const Ftype &parameters, bool sendAuthCookie=false)
 
template<typename Ftype >
bool opWebRpc (const Common::JString &uriPath, const Ftype pParameterArray, int arrSize, bool sendAuthCookie=false)
 
template<typename Ftype >
bool opWebRpc (const Common::JString &uriPath, const Ftype pParameterArray, const int *pArrSizes, bool sendAuthCookie=false)
 
virtual bool opGetRoomList (const Common::JString &lobby, const Common::JString &sqlLobbyFilter)
 
virtual bool opGetRegions (bool encrypted, const Common::JString &appID)
 
virtual bool opSetPropertiesOfPlayer (int playerNr, const Common::Hashtable &properties, const Common::Hashtable &expectedProperties=Common::Hashtable(), WebFlags webFlags=WebFlags())
 
virtual bool opSetPropertiesOfRoom (const Common::Hashtable &properties, const Common::Hashtable &expectedProperties=Common::Hashtable(), WebFlags webFlags=WebFlags())
 
- Public Member Functions inherited from PhotonPeer
 PhotonPeer (PhotonListener &listener, nByte connectionProtocol=ConnectionProtocol::DEFAULT, nByte serializationProtocol=Common::SerializationProtocol::DEFAULT)
 
virtual ~PhotonPeer (void)
 
virtual bool connect (const Common::JString &ipAddr, const Common::JString &appID=Common::JString())
 
template<typename Ftype >
bool connect (const Common::JString &ipAddr, const Common::JString &appID, const Ftype &customData)
 
template<typename Ftype >
bool connect (const Common::JString &ipAddr, const Common::JString &appID, const Ftype pCustomDataArray, int arrSize)
 
template<typename Ftype >
bool connect (const Common::JString &ipAddr, const Common::JString &appID, const Ftype pCustomDataArray, const int *pArrSizes)
 
virtual void service (bool dispatchIncomingCommands=true)
 
virtual void serviceBasic (void)
 
virtual bool opCustom (const OperationRequest &operationRequest, bool sendReliable, nByte channelID=0, bool encrypt=false)
 
virtual bool sendOutgoingCommands (void)
 
virtual bool sendAcksOnly (void)
 
virtual bool dispatchIncomingCommands (void)
 
virtual bool establishEncryption (void)
 
virtual void fetchServerTimestamp (void)
 
virtual void resetTrafficStats (void)
 
virtual void resetTrafficStatsMaximumCounters (void)
 
virtual Common::JString vitalStatsToString (bool all) const
 
virtual void pingServer (const Common::JString &address, unsigned int pingAttempts)
 
virtual void initUserDataEncryption (const Common::JVector< nByte > &secret)
 
virtual void initUDPEncryption (const Common::JVector< nByte > &encryptSecret)
 
PhotonListenergetListener (void)
 
int getServerTimeOffset (void) const
 
int getServerTime (void) const
 
int getBytesOut (void) const
 
int getBytesIn (void) const
 
int getByteCountCurrentDispatch (void) const
 
int getByteCountLastOperation (void) const
 
int getPeerState (void) const
 
int getSentCountAllowance (void) const
 
void setSentCountAllowance (int sentCountAllowance)
 
int getTimePingInterval (void) const
 
void setTimePingInterval (int timePingInterval)
 
int getRoundTripTime (void) const
 
int getRoundTripTimeVariance (void) const
 
int getTimestampOfLastSocketReceive (void) const
 
int getDebugOutputLevel (void) const
 
bool setDebugOutputLevel (int debugLevel)
 
const Common::LogFormatOptionsgetLogFormatOptions (void) const
 
void setLogFormatOptions (const Common::LogFormatOptions &formatOptions)
 
int getIncomingReliableCommandsCount (void) const
 
short getPeerID (void) const
 
int getDisconnectTimeout (void) const
 
void setDisconnectTimeout (int disconnectTimeout)
 
int getQueuedIncomingCommands (void) const
 
int getQueuedOutgoingCommands (void) const
 
Common::JString getServerAddress (void) const
 
bool getIsPayloadEncryptionAvailable (void) const
 
bool getIsEncryptionAvailable (void) const
 
int getResentReliableCommands (void) const
 
int getLimitOfUnreliableCommands (void) const
 
void setLimitOfUnreliableCommands (int value)
 
bool getCRCEnabled (void) const
 
void setCRCEnabled (bool crcEnabled)
 
int getPacketLossByCRC (void) const
 
bool getTrafficStatsEnabled (void) const
 
void setTrafficStatsEnabled (bool trafficStasEnabled)
 
int getTrafficStatsElapsedMs (void) const
 
const TrafficStatsgetTrafficStatsIncoming (void) const
 
const TrafficStatsgetTrafficStatsOutgoing (void) const
 
const TrafficStatsGameLevelgetTrafficStatsGameLevel (void) const
 
nByte getQuickResendAttempts (void) const
 
void setQuickResendAttempts (nByte quickResendAttempts)
 
nByte getConnectionProtocol (void) const
 
void setConnectionProtocol (nByte connectionProtocol)
 
nByte getChannelCountUserChannels (void) const
 
nByte getSerializationProtocol (void) const
 

Additional Inherited Members

- Static Public Member Functions inherited from PhotonPeer
static short getPeerCount (void)
 
static unsigned int getMaxAppIDLength (void)
 

Member Function Documentation

◆ disconnect()

void disconnect ( void  )
virtual

Initiates the disconnection from the Photon server. The servers response will arrive in PhotonListener::onStatusChanged().

This function generates a disconnection request that will be sent to the Photon server. If the disconnection is completed successfully, then the PhotonListener::onStatusChanged() callback will be called, with a statusCode of StatusCode::DISCONNECT.

Remarks
If a game room is joined, when this function gets called, then the local player leaves that room as if opLeaveRoom() has been called with parameter 'willComeBack' set to 'true'. Please see there for further information about leaving rooms. However no call to Listener::leaveRoomReturn() will happen when leaving a game room is triggered through a call to disconnect().
See also
connect()

Reimplemented from PhotonPeer.