LitePeer, how to start !?!?!?!

Options
Ozden79
Ozden79
edited April 2015 in Native
I'm having difficulty on how to get LitePeer working on Cocos2d-x SDK. Comparing to LoadBalancing (I'll be honest and cruel as it is a mess and presented in the worst written example apps/code I've ever seen in a SDK :evil: (sorry but please accept these as a harsh criticism)), in LitePeer everything seems to be more clean so I decided to use it instead but did stumble on first step, I can't even connect to photon cloud!

virtual bool connect(const Common::JString& ipAddr, const nByte appID[Internal::InternalProperties::APP_NAME_LENGTH]=NULL);

"connect" method expects a server IP which is not available in any area of the documentation or in the website and the second parameter appId is requested in a way that I couldn't understand !?!?!

Could you please help me on these baby steps?

Thanks,

Ozden

Comments

  • Kaiserludi
    Options
    Hi Ozden79.

    Your critique might be honest, but it is not constructive. If you don't tell us what exactly you dislike about LoadBalancing and its demos then we can't do anything about it.

    LitePeer is not compatible to the Photon Cloud, but only intended to be used with Photon Server. The value to pass in for the IP address therefor can't be made available by us in our documentation, as we simply don't know where our Photon Server customers host their servers.

    I am not sure what you don't understand about the second parameter. appID is an array of size APP_NAME_LENGTH and type nByte and it is completely optional (therefor the "=NULL") - if you don't pass in a second parameter at all, then we will use the default value "Lite".

    I am afraid that you will need do bite the bullet and get more familiar with LoadBalancing if you want to use Photon Cloud. Hopefully you will then realize that it is far better than you first thought.
  • Ozden79
    Options
    First of all, thanks for the reply...

    Well, please correct me if I'm wrong but, I haven't seen in any part of the website/C++ documentation that states "LitePeer" can only be used with Photon Server? When I downloaded the C++ SDK and started to check the docs, "LoadBalancing" topic was (and still is) empty where on the other hand there is a "Photon" topic with all kinds of "how to start" related stuff in it which describes the workflow and setup of "LitePeer". Again, there is no mention that it cannot be used on PhotonCloud so I started to build my code around it until I realized something is wrong.

    About the sample codes, especially LoadBalancing, I'm sure that the way it was written is no where friendly to a newcommer. Even the iOS UI created in it is done in a rather unusual way. Apart that, when the docs only gives some nice info about "LitePeer" and you compare it with "LoadBalancing" code you see, there is nearly nothing common in between them which confuses a lot.

    I hope you understand that this complaint is constructive rather than just showing anger to you since I look into your showcase portfolio, which is very strong, I expected a much more mature framework on every aspect than what I saw so far.

    Anyway, after that, as you said, I bite the bullet and started to use LoadBalance. After some steps, I realized that "opJoinRandomRoom" couldn't find the room that was created by another client. I checked "getRooms()" and my created room was there but still I was getting "NO_MATCH_FOUND" on "joinRandomRoomReturn". A small search on your forum led to this post :

    viewtopic.php?f=8&t=1820&p=8613&hilit=joinrandom#p8613

    I'm setting "MaxPlayer" and this seems to be causing a no match while searching for a room and without stating it, things seems fine. The above topic is from 2012 and does your servers still have that issue?

    Regards,

    Ozden
  • Kaiserludi
    Options
    Hi again.

    Yes, the docs could certainly be improved.
    Even the iOS UI created in it is done in a rather unusual way.
    I am not sure what you mean by that. in which way is it unusual?
    After some steps, I realized that "opJoinRandomRoom" couldn't find the room that was created by another client. I checked "getRooms()" and my created room was there but still I was getting "NO_MATCH_FOUND" on "joinRandomRoomReturn". A small search on your forum led to this post :

    viewtopic.php?f=8&t=1820&p=8613&hilit=joinrandom#p8613

    I'm setting "MaxPlayer" and this seems to be causing a no match while searching for a room and without stating it, things seems fine. The above topic is from 2012 and does your servers still have that issue?
    No, that issue has been fixed long ago.

    I have verified it myself today and it works or me.

    Please try the following:
    Start 2 instances of demo_loadbalancing with the original code without any changes by yourself except for setting the appID to a valid value.
    Let one instance create a room and the other on join a random room.
    If this is working, change the implementation of void NetworkLogic::opJoinRandomRoom(void) from
    [code2=cpp]void NetworkLogic::opJoinRandomRoom(void)
    {
    mLoadBalancingClient.opJoinRandomRoom();
    }[/code2]

    to

    [code2=cpp]void NetworkLogic::opJoinRandomRoom(void)
    {
    mLoadBalancingClient.opJoinRandomRoom(ExitGames::Common::Hashtable(), 4);
    }[/code2]

    and try again.

    Does this work for you?
  • Ozden79
    Options
    Hi There,
    I am not sure what you mean by that. in which way is it unusual?

    iOS sample screen is constructed on AppDelegate file rather than using a designer and maybe a proper code file attached to designed screens. The code in the sample is not easily readable, with nearly non existant comments and guidance. I can assure you that your current state docs + sample apps will scare a lot of potential customers, especially who are newbie into development world. Just my suggestions as mentioned previously.
    No, that issue has been fixed long ago.

    It works on your example and a close inspection shows that if I don't specify a maximum number of players while creating a room (as I did in my code), it's still not working. like :
    MyClient->opCreateRoom(JString());
    

    for creating room and than :
    MyClient->opJoinRandomRoom(ExitGames::Common::Hashtable(), 4);
    

    to join that room does not work.

    Thanks,

    Özden
  • Kaiserludi
    Options
    Hi Özden.
    Ozden79 wrote:
    It works on your example and a close inspection shows that if I don't specify a maximum number of players while creating a room (as I did in my code), it's still not working. like :
    MyClient->opCreateRoom(JString());
    



    for creating room and than :
    MyClient->opJoinRandomRoom(ExitGames::Common::Hashtable(), 4);
    

    to join that room does not work.

    Thanks,

    Özden

    You don't specify anything for the maxPlayers parameter in opCreateGame(), so it is the expected and correct behavior for the server to not find that room when it should look only for rooms for which a maxPlayers value of 4 has been specified.