Search Unity

Third Party Memory Game demo (Photon Server)

Discussion in 'Multiplayer' started by Bleugris, Sep 21, 2016.

  1. Bleugris

    Bleugris

    Joined:
    Sep 20, 2016
    Posts:
    3
    Hello,

    I am developping a multiplayer application with PUN. I have no problem to configure this. Indeed, I have the players which they are synchronized. The problem is to make a persistent multiplayer application. I saw that I had to create a webhook with Photon Server. I read the documentation but, I can't find the Memory Game demo. I don't know if I look poorly. I would like to know where is the demo or else, if there is an alternative solution to make a persistent application.

    Thanks in advance
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
  3. Bleugris

    Bleugris

    Joined:
    Sep 20, 2016
    Posts:
    3
    Thanks tobiass,

    I downloaded the demo. I test the scene and create my own URL which is the BaseUrl. There are no problems with the connexion. However, when I create a new game, the console write "Getting into game failed, client stays on masterserver: OperationResponse 225: ReturnCode: 32760 (No match found). Parameters{}" and "Join or Create
    failed for: 'Code:32752 Msg: Failed to create game on 'http://www.myurl.com/folder/index.html/(characters of AppId)/GameCreate? : 'Not Found'".

    There is a thing that I don't understand. It is the BaseUrl (the paths also but, I think there is a link with the BaseUrl). What is this ? An url which contains a history of modifications in the multiplayer applications ? The term "hook" doesn't tell me at all.

    My BaseUrl's link is : http://www.myurl.com/folder/index.html/{AppId}. And the page (url : http://www.myurl.com/folder/index.html) contains anything.
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    The BaseUrl is the part of the address, that's always the same. It excludes the WebHook name/path.
    Per WebHook, we add a string/name to the path (BaseUrl), so different WebHooks can be implemented as different request paths. In our case, we don't call a specific html file but just a path like: http://www.url.com/myapp/{appid}/GameCreate/
    Each WebHook has a special task/meaning. They get different input in most cases.


    This might help:
    https://doc.photonengine.com/en/realtime/current/reference/webhooks
     
  5. Bleugris

    Bleugris

    Joined:
    Sep 20, 2016
    Posts:
    3
    Ok, I read the documentation and your post. Now, I understand the baseUrl and the paths. I create the {AppId} and the GameCreate folders. But, I get an other error : "Response is not valid json". Does the CreateGame has to include code ?

    Sorry, It's the first time that I make a persistent application
     
  6. JohnTube

    JohnTube

    Joined:
    Sep 29, 2014
    Posts:
    66
    Hi @Ecarpis,

    Webhooks implementation should return JSON only as explained here.
    Yes. Webhooks need coding on web service side. Please take a look at some of the sample implementations linked here. They can help you get started.
    I think that this is specific to your implementation. And to avoid any confusion or misunderstanding, you don't really need the "{AppId}" URL tag in the "BaseURL". So it can be "https://www.example.com". To read more about URL tags visit this link. I don't think you need them at this point. Let's just make basic things work for you.
    You can also use other tools to help you in webhooks development like ngrok, runscope and postman.
    They can also be confusion and look complicated for a beginner. You can avoid them if you know how to test your web endpoints.