Help setting up the demo webhooks on own server (Unity)

Options
Hi there.

I'm trying to setup the demo webhooks example (https://github.com/exitgames/photon.web ... based.waws) on my own Azure account. The readme there has been very helpful and I seem to be getting there. Unfortunately though there's not that much information especially as this is all new to me, and I've gotten stuck. If anybody can help me out that would be great.

WHAT I WANT TO ACHIEVE

I would like to have my own copy of the webhooks example running on my Azure account, so that I can play around with the webhooks logic and be sure that it is properly working. I wouldn't mind not having it live if that means having more complications, but I think would prefer to know that part is done.

WHERE I'M AT NOW

As per the readme I have

-Made and tested a photon application/id with the example scenes
-Installed Visual Studio (professional with update 2)
-Enabled IIS (windows 7 ultimate)
-Setup ngrok
-Built the webhooks project and edited web.config accordingly (DataAccess, AzureAccountName, AzureAccountKey as per option 1)
-Edited the webhooks values for the app on photon

At the moment I'm stuck because when I run the client I find that it's not joining games or anything. I notice that I don't seem to be getting any responses when looking at ngrok and the readme seems to suggest that I should.

4cbf638bd4.png

The demo client is giving me this response:

WebRpc-Response: OperationResponse 219: ReturnCode: -5 (webRpc request to address http://375b7118.ngrok.com/turnbased/bfc ... etGameList? failed. WebStatus:ServerProtocolViolation, Exception :System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine

and

Create failed on GameServer. Changing back to MasterServer. ReturnCode: 32756
UnityEngine.Debug:Log(Object)
DemoGame:DebugReturn(DebugLevel, String) (at Assets/Demo/DemoGame.cs:174)
ExitGames.Client.Photon.LoadBalancing.LoadBalancingClient:GameEnteredOnGameServer(OperationResponse) (at Assets/LoadbalancingApi/LoadBalancingClient.cs:1332)
ExitGames.Client.Photon.LoadBalancing.LoadBalancingClient:OnOperationResponse(OperationResponse) (at Assets/LoadbalancingApi/LoadBalancingClient.cs:1567)
DemoGame:OnOperationResponse(OperationResponse) (at Assets/Demo/DemoGame.cs:41)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])

So my guess is that the requests are failing to meet there target, the server application. What I don't understand is why a game server can't be joined if that's all done on photon servers and not the web application. Also the readme makes note of a virtual directory, I'm speculating whether this is how the webhooks are forwarded to my machine and possibly my config is to blame, perhaps /turnbased/... is not there when it should be.

If you have any idea how I might be going wrong or if you can clear the following up for me, (or if you would need any other information) please let me know.

1- How is the client supposed to connect to the application I just built in visual studio via the base url: /turnbased/[your app id]/ . I understand that ngrok is supposed to be forwarding the requests/responses to where exactly too?

2- Is it just worth me skipping ahead and publishing to the azure account, and if so how best should I go about it, the final instructions on the readme are quite vague, having ngrok show the requests/responses seems very useful would I be able to do that when using a live Azure version? and would I need this Regis setup properly too.

Please any insight/clarification would be much appreciated.

Comments

  • v1r7u3
    Options
    After trying again today I've been getting this error, it seems like the requests are going to the correct location (my local repo) but the config file cannot be read. I'm non the wiser how to fix this though.


    91ba1ae659.png
  • v1r7u3
    Options
    FIXED IT!

    It was just a couple issues with my IIS components I needed to enable some of the development features and re register asp.net:

    http://stackoverflow.com/questions/1316 ... 3#13266763

    I would still appreciate any insight regarding any of this.
  • Hello,

    Glad you could fix the configuration yourself.

    After setting up the webhooks every game you try to create the PhotonCloud calls the GameCreate webhook which is in charge of giving the client permission to create game. So after setting up webhooks you game will not work unless you have the webhooks working.

    Also I would guide you to remove your application key from pictures you send here in future.

    1. Photon clients do not connect to your server directly instead they connect trough PhotonCloud via WebRpc (GetGameList) or PhotonCloud calls per Webhook.

    Ngrok basically just takes your computer and removes NAT and other blocking things in front of your computer making it easier to develop web applications. Guiding the web calls to that Ngrok computer making it possible for you to run local webserver and showing it online. This is good for development, but not really for production.


    2. Ngrok does only work for development forwarding to your machine – for cloud service you need something like Runscope. https://www.runscope.com/
    You can deploy the service to Azure if you want. This will make your service run in cloud.

    I myself would develop first in local environment to keep server costs zero until server side is pretty much done and then release to cloud when your service is ready for testing. This however is my preference.

    If you decide to use Azure Websites start with free and it should work see http://azure.microsoft.com/en-us/pricin ... web-sites/
  • v1r7u3
    Options
    Thanks alot for getting back, and for the tips.

    Yea once I got it working I realized there would be no point deploying the project to an azure site until development was complete.
  • Glad I could help.