Cloud with Marmalade c++

Terminatori777
edited July 2012 in Native
Hi
I'm trying to use Photon Cloud with Marmalade SDK in c++, but getting a bit confused over the differences in documentation, tutorials and samples.
I would just want to make a simple application that sends and receives data between a client and a server, through the Photon Cloud.

Q1:
Where do i found this PhotonListener::PhotonPeerReturn() callback function wich is refered to in "The Exit Games Photon API Reference Doc" and PhotonPeer.h ?
PhotonListener::PhotonPeerReturn() i supposed to return codes as SC_CONNECT, OPC_RT_JOIN, SC_DISCONNECT etc.

The only callback functions i can find in PhotonListener are:

virtual void onOperationResponse(const OperationResponse& operationResponse);
virtual void onStatusChanged(int statusCode);
virtual void onEvent(const EventData& eventData);

If these are the functions you mean, do i have to implement the onOperationResponse(), onStatusChanged() and onEvent() in the same way as in the LoadBalancing sample, which i think is a bit difficult to understand.

Q2:
Another part in in the pdf doc(1.4 basic) says that i should call PhotonPeer_Connect() function and
receive return codes to PEERRETURN_CB callback function.

When should i use PhotonPeer_Connect? and when PhotonPeer::Connect()?


Q3:
The PLAIN Tutorial (http://doc.exitgames.com/photon-cloud/O ... #cat-PLAIN )
seems clean and simple, but i cant't find any similar for C++.
Is that only for C# ?

Q4:
What is the easiest way to connect and send data through the Photon cloud?


Sorry if these are stupid questions or if I have have missed something, but i just can't find the answers anywhere.
Thanx in advance.

Comments

  • > do i have to implement the onOperationResponse(), onStatusChanged() and onEvent() in the same way as in the LoadBalancing sample, which i think is a bit difficult to understand.
    Yes, those are the methods you have to implement as callback functions. The documentation in the doc might be wrong - we split that single function into 3 distinct ones a while ago.
    The LoadBalancing sample is difficult to understand? We tried to keep anything more complex out of that sample, so the code would be simple.

    > When should i use PhotonPeer_Connect? and when PhotonPeer::Connect()?
    I'm not the coder of that API but for me, it looks like the difference between the C and the C++ API. C++ can overload methods and has object orientation. Use C++ style code whenever you can.

    > The PLAIN Tutorial ... only for C# ?
    Yes. Currently.

    > What is the easiest way to connect and send data through the Photon cloud?
    Please have a look at the Loadbalancing Demo. The code and workflow is the same for Loadbalancing and the Cloud. You would only have to change the master address and the AppId to make your loadbalancing code run with the Photon Cloud service.
  • Thanks for the quick answer.
    I think i got it.
    I will use the LoadBalance project in my project, the same way its used in the LoadBalance demo.
    The difficult and confusing thing was that i didnt find any description of the LoadBalance API.
    I think i understand how it work now.
    Thanx again
    /T
  • Hi Terminatori777.

    Q1:
    Tobias is right here. The docs are a bit outdated. This has already been fixed, but not released, yet.

    Q2: It has looke correctly to my colleague: PhotonPeer_connect is from the C API. THe C++ API doc ofter just refers to the C API doc to avoid redundence. However, if your code can use C++, then I would recommend to use the C++ API.

    Q4:
    Sorry. The C++ LoadBalancing documentation does not exist, yet, but we are on it and it is planned to be released this autumn or with luck in late summer. In the meantime please refer to the sourcecode (LB is completely open source) and if there are remaining questions about it, please just ask.