Photon C++ Client API
5.0.7.3
|
Public Member Functions | |
SendDirectOptions (const Common::JVector< int > &targetPlayers=Common::JVector< int >(), bool fallbackRelay=false, nByte receiverGroup=Lite::ReceiverGroup::OTHERS) | |
~SendDirectOptions (void) | |
SendDirectOptions (const SendDirectOptions &toCopy) | |
SendDirectOptions & | operator= (const SendDirectOptions &toCopy) |
const Common::JVector< int > & | getTargetPlayers (void) const |
SendDirectOptions & | setTargetPlayers (const Common::JVector< int > &targetPlayers) |
nByte | getReceiverGroup (void) const |
SendDirectOptions & | setReceiverGroup (nByte receiverGroup) |
bool | getFallbackRelay (void) const |
SendDirectOptions & | setFallbackRelay (bool fallbackRelay) |
virtual Common::JString & | toString (Common::JString &retStr, bool withTypes=false) const |
virtual JString & | toString (JString &retStr, bool withTypes=false) const=0 |
JString | toString (bool withTypes=false) const |
Public Member Functions inherited from ToString | |
virtual | ~ToString (void) |
virtual JString | typeToString (void) const |
JString | toString (bool withTypes=false) const |
This class aggregates the various optional parameters that can be passed to Client::sendDirect().
SendDirectOptions | ( | const Common::JVector< int > & | targetPlayers = Common::JVector<int>() , |
bool | fallbackRelay = false , |
||
nByte | receiverGroup = Lite::ReceiverGroup::OTHERS |
||
) |
Constructor: Creates a new instance with the specified parameters.
targetPlayers | see setTargetPlayers() - optional, defaults to an empty JVector<int>. |
fallbackRelay | see setFallbackRelay() - optional, defaults to false. |
receiverGroup | see setReceiverGroup() - optional, defaults to Lite::ReceiverGroup::OTHERS. |
~SendDirectOptions | ( | void | ) |
Destructor.
SendDirectOptions | ( | const SendDirectOptions & | toCopy | ) |
Copy-Constructor: Creates a new instance that is a deep copy of the argument instance.
toCopy | The instance to copy. |
SendDirectOptions & operator= | ( | const SendDirectOptions & | toCopy | ) |
operator=.
Makes a deep copy of its right operand into its left operand.
This overwrites old data in the left operand.
const JVector< int > & getTargetPlayers | ( | void | ) | const |
SendDirectOptions & setTargetPlayers | ( | const Common::JVector< int > & | targetPlayers | ) |
Sets the target players.
Set this to the player numbers of the clients, which should receive the event. The default value when not setting anything is an empty JVector and equivalent to a JVector that consists of the player numbers of all clients inside the room except for the sending client itself. Player Numbers that do not correspond to any active player inside the room get ignored.
targetPlayers | either an empty JVector (to reset the value of the option to the default) or an array of integer values that correspond to the player numbers of the intended receivers |
nByte getReceiverGroup | ( | void | ) | const |
SendDirectOptions & setReceiverGroup | ( | nByte | receiverGroup | ) |
Sets the receiver group.
Set this to one of the values from Lite::ReceiverGroup. The default value when not setting anything is Lite::ReceiverGroup::OTHERS.
receiverGroup | needs to be one of the values from Lite::ReceiverGroup |
bool getFallbackRelay | ( | void | ) | const |
SendDirectOptions & setFallbackRelay | ( | bool | fallbackRelay | ) |
Turns the fallback relay option on or off.
When the fallback relay option is turned on, then the message is relayed through the game server via opRaiseEvent() for all specified receivers to which no direct connection exists. When it is turned off, then it is only sent to recipients to which a direct connection exists and not to any other recipients. sendDirect() returns the number of recipients to which the message could be sent out. If the fallback relay option is turned on, then this number includes the recipients for which the fallback relay has been used.
fallbackRelay | true if the Photon game server that hosts the room should be used as a fallback relay (by an automatic call to opRaiseEvent()) for all specified receivers to which no direct connection exists, false otherwise |
|
virtual |
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
Implements ToString.
toString |
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
JString toString |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
withTypes | set to true, to include type information in the generated string |