Photon C++ Client API: Peer Class Reference

Photon C++ Client API

Photon C++ Client API  4.1.12.2
Inheritance diagram for Peer:
Collaboration diagram for Peer:

Public Member Functions

 Peer (Photon::PhotonListener &listener, nByte connectionProtocol=Photon::ConnectionProtocol::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, 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::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, typename Common::Helpers::ArrayLengthType< Ftype >::type arrSize, nByte eventCode, const RaiseEventOptions &options=RaiseEventOptions())
 
template<typename Ftype >
bool opRaiseEvent (bool reliable, const Ftype pParameterArray, const short *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, typename Common::Helpers::ArrayLengthType< Ftype >::type arrSize, bool sendAuthCookie=false)
 
template<typename Ftype >
bool opWebRpc (const Common::JString &uriPath, const Ftype pParameterArray, const short *pArrSizes, bool sendAuthCookie=false)
 
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)
 
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, typename Common::Helpers::ArrayLengthType< Ftype >::type arrSize)
 
template<typename Ftype >
bool connect (const Common::JString &ipAddr, const Common::JString &appID, const Ftype pCustomDataArray, const short *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, const Common::JVector< nByte > &HMACSecret)
 
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
 

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.