Photon C++ Client API: Sending and receiving data

Photon C++ Client API

Photon C++ Client API  4.1.12.2
Sending and receiving data

How to send data to other players

In Photon you exchange data with other players by sending and receiving "Operations" and "Events". Please refer to Operations for more information about this concept.

The cross-platform communication ability of Photon implies the need for common data structures across all the different client versions. Please refer to Datatypes for a table of supported types and their equivalents on the server side.

When your Hashtable is complete, use opRaiseEvent() (or opCustom(), if you implemented custom types of operations on the server) to initiate the transmission.

Receiving Data

Photon will interact with your application by calling the callback functions you implemented, thereby passing data structures as arguments. All these data structures belong to Photon, which means that Photon is responsible for deleting them. This will happen as soon as the callback function has returned.

So your application is responsible A) for extracting and copying any data needed from the arguments within the callback function, and of course

B) for later freeing up the memory needed for those copies, as usual.