Customized data type serialization problem

Options
I want to seeialize my own custom data type, such as struct or class , how to do that ? the client use unreal4(C++ client SDK)

Comments

  • Kaiserludi
    Options
    Hi @oman.

    You can use Common::CustomType for this: http://doc-api.photonengine.com/en/cpp/current/html/a00056.html

    For an example implementation of a custom type please see demo_typesupport inside the demos folder of the C++ Client SDK of your choice.

    For example code on how you would implement serialize() and deserialize() for a more complex custom type than the one that is implemented in the demo_typesupport, please see http://forum.photonengine.com/discussion/comment/22127#Comment_22127
  • oman
    Options
    thanks kaiserludi! We found when we use C++ SDK to send operationRequest to server , if We don't set any data object(We needn't send any data to server, just an empty operationRequest with operationCode), the server can't receive the operationRequest, but with UnitySDK, doesn't have this problem, what's the reason?
  • Kaiserludi
    Kaiserludi admin
    edited June 2016
    Options
    Hi @oman.

    I have done a quick test with one of our demos and it works just fine for me.
    A line like this send to a not-modified-server or the Photon Cloud (which do not implement an operation with code 1
    mLoadBalancingClient.opCustom(ExitGames::Photon::OperationRequest(1), true);
    correctly triggers a server response with an "unknown operation" error message, which obviously means that the empty operation has reached the server just fine.

    Could you provide reproduction code, please?