Converting ExitGames::Common::Object to ExitGames::Common::JVector

Options
Hey,

So I'm raising custom event and sending JVector data to the network, and on receiving event I get this Object.

I'm wondering if I can convert Object into JVector on an event received, it keeps giving me compiler error by doing ValueObject>(Object);

Is there anyway to receive my value back in JVector format?
Thanks

Comments

  • Kaiserludi
    Options
    Hi @kingathur61.

    You are sending a JVector with opRaiseEvent()? How do you manage to do that? Sending a JVector is not supported out of the box, so you would need to convert it to an array first or to add it as CustomType. Accordingly you must of cause convert it back on receival, as there is no was the received event could possibly hold a JVector.
  • kingathur61
    Options
    Hey @Kaiserludi, thanks for the reply. I didn't know that JVector is not supported, and yeah it gives me null in the receive event. So now im converting them into Hashtable* array, and it requires me to send also total of data in the array. My new question is, how do I access total of array data in the receiving event? thanks
  • kingathur61
    Options
    Oh nevermind, I found getSizes() from Object class,
    thanks for your help! the documentation for c++ is quite scarce for some parts, unlike the .net version one so I kinda need to see the example what the functions are for
  • Kaiserludi
    Options
    Hi @kingathur61.

    Please see here for a list of supported data types:
    http://doc-api.photonengine.com/en/cpp/current/html/a00038.html

    Object::getSizes() is documented here:
    http://doc-api.photonengine.com/en/cpp/current/html/a00079.html#a85eab09bf418884b98a09acc872b96ce

    I agree that the C++ doc is quite scarce for some parts, but actually data type support and containers belong to the better documented parts:
    http://doc-api.photonengine.com/en/cpp/current/html/a00341.html

    For an example on how to send various kind of structures, please have a look at demo_typesupport inside the Client SDK.

    With issues like this one calls to toString() on Dictionary- Hashtable-, JVector- or Object instances often can help a lot in tracking down which line of your code does not have the results you expect it to have.