Beginner Questions (App From Scratch)

Options
honeybadger_jay
edited September 2013 in Photon Server
Hi tobias et. al,

I'm starting to build an app from scratch and I have a few beginner questions regarding Photon Server self-hosted that I haven't been able to find an answer about in the documentation:

1. What is the difference between running as an application and a service and how would I configure between the two?
2. If I have a number of applications on the same instance node, can I run more than one at the same time? What happens if I try to run one and then the other? I.E. peer.Connect("localhost", "Lite") and then Connect("localhost", "ChatServer") when those are set up in the photon.config under the same Default node?

I'm having trouble getting the chat operation to work as expected. I've been debugging for a few hrs and I'm fairly certain the issue is in my server configuration and my custom app is not running at all and I'm getting behaviour from Lite instead. I'm fairly sure I've got the bin directory set up correctly but I'm not seeing any logs or auto-restart behaviour for my DLL or configs so its likely a config issue yea? Actually, my bin_win64 is missing a log folder which I don't get either. Links to some advanced docs on setting up application configs that I may have missed would be great. Gonna look into the logging docs now. Really hard to debug without any logs!

Thanks,
Jay

Comments

  • Follow Up Question: What sort of environment variables are used and where would I change them? I noticed the log4net.config uses things like {Photon.ApplicationLogPath}. I have a few older version of Photon laying around on my hard drive and I've been thinking I might have some environment variables set up for the old folder paths (this is true, at least for the baretail logs because they try to open some old logs). Looked through the registry but didn't find anything for Exit Games inside there..
  • Finally got it!! I had to reinstall the service to set up a new logs file and whatnot. Looks like the new deploy folder was picking up the old "Default" installation from another folder, which is why there were no log folders set up.

    It might be a handy option to the self-extracting exe to clear the old installs?
  • Hi,

    glad to hear that you figured it out :)

    To answer your questions anyway:
    1.) The application is just a console application (it will be stopped if the current user is logged out). The service is a Windows Service. The application is fine for local development and quick testing, but we recommend to install Photon as a Windows Service on production machines.
    2.) You can host several applications in the same Photon instance (for example, in the "default" instance).
    However, a (client-side) peer can only connect to one application at a time - in your example: if you want to connect to the chat server, you need to disconnect from Lite first.

    And yes, as you noticed: if Photon is installed as a service, it takes configs & default paths from the original install path.