Photon Control is your one-stop, control UI for Photon. Starting "PhotonControl.exe" doesn't open a window, doesn't start the server but adds an icon to the tray bar.
A gray icon shows that Photon is not running. When any Photon Server is process running, the icon turns blue.
- Running Photon
- Moving Photon
- Changing the "LoadBalancing IP Config" Path
- PerfMon Counters
- Dashboard Counters
- Dump File Setup
Click the icon to open the menu. It allows you to:
- Start and stop Photon.
- Install, start and stop Photon services.
- Change the game server config for "LoadBalancing (MyCloud)".
- Setup and open Photon's Performance Monitor (PerfMon) Counters.
- Open the log files.
- Open working path in Explorer.
- Verify you are using the latest version of Photon.
Admin rights are required when you start Photon Control. This allows us to make an entry in the Windows Firewall and most importantly you can now add or remove services for Photon.
On start, Photon Control reads your license to let you verify how long it is valid and checks if you use the latest version of Photon, shown in the "Photon Control" menu.
The "Autostart Photon Control" option starts Photon Control when you login to Windows. This can be handy when you access a remote machine and can use "Explore Working Path" to spot Photon's files.
If the icon is not visible, click the tiny triangle and drag and drop the Photon Control icon from the popup back to the tray.
By default, two separate Photon configurations (also called "Instances") are available. Each starts a combination of server applications and used ports. Starting instance "LoadBalancing (MyCloud)" will run a Master Server and two Game Servers, which is a minimum Photon Cloud compatible setup. The second instance is "MMO Demo".
On a public server, Photon should run as service. This requires three steps in Photon Control:
- Install the Photon service
- Install the PerfMon Counters (they might prove useful)
- Start Photon as service
The PerfMon Counters are not exactly a requirement to run but they can't be enabled while Photon is running, so it makes sense to set them up first.
Running Photon as application is an alternative for local development. When you log off, Photon will be shut down.
Before you move Photon from one folder to another, you should make sure to remove all services and also Photon Control autostart. Install again at the new location.
While Photon Control can't be modified extensively, some important settings can be found in "PhotonControl.exe.config". The "GameServerConfigPaths" setting is the one you might need when your project is based off LoadBalancing but renamed.
The GameServerConfigPaths is a list of ';'-separated paths, relative to the folder of "PhotonControl.exe".
Photon is logging essential information (state, exceptions, etc.) to several log files. Click on "Open Logs" to show all logs that Photon used in the past 12 hours. You can open more files as needed, of course.
There are two "log" folders:
- All application logs are in the deploy/log folder. Anything that is logged by your business logic goes into a fitting file in deploy/log.
- The server core's log folder is where your running executable is (e.g. bin_win32/log). They contain anything instance and CLR (.NET runtime) related.
We use Log4Net in the logic layer. It can be configured extensively and proved very useful. Learn more about Log4Net here.
Photon keeps track of several essential values as support for performance- and error-analysis. These are published in two separate sets of Counters: "PerfMon Counters" and "Dashboard Counters".
The PerfMon Counters are key values from the Photon Core. They track values like connected peers, package count, reliable UDP usage, traffic and much more. These Counters cannot be changed by the developer and are accessed by PerfMon. PerfMon is a GUI to create those performance graphs and is already installed with Windows.
If PerfMon Counters should be logged over a longer time (and without running the GUI), Photon Control can setup and start logging to a file.
Under "PerfMon Counters", click "Create Logging Set" and "Start Logging".
The logs should end up under "C:\PerfLogs\Admin\photon_perf_log_
The Dashboard Counters track values within the business logic and can be extended as needed.
The Dashboard aggregates counter values and generates graphs for a website to monitor them.
The Dashboard itself can be installed as service while Photon is already running. Which Counter Data an application publishes (if at all), depends on the application's setup. LoadBalancing has several pre-defined Counters ready to use.
If Photon does not behave as expected, always have a look at the logs.
These are the most common pitfalls you should check as well.
- Missing .NET 4.0: In this case, Photon can't start. Don't mix this up with the CLR Version.
- Application missing: If Photon does not find one of the configured applications, it can't start. Check the configuration against deployed folders.
- Build not up to date: Switching to a new server SDK, you should always re-build your applications, referencing the assemblies from the libs folder. Otherwise they might be incompatible.
- Firewall: If Photon is running but not accessible from another machine, check the Firewalls. Newer Windows versions have roles and rights and your hoster most likely used hardware firewalls.
- Lag: By default, the roundtrip time is about 50ms, even locally. This depends on a setting, explained on the setup page. Read: Send Delay and Ack Delay
If a server crashes and the reason for it is not found in the logs, Photon can be configured to create dump files. These reflect the state and memory of the crash and are invaluable to debug these cases.
To enable the feature, you need to edit your "PhotonServer.config". Set the instance-attribute "ProduceDumps" to true and restart the server. It might look like this example:
<Default EnablePerformanceCounters = "true" DataSendingDelayMilliseconds="50" AckSendingDelayMilliseconds="50" MinimumTimeout="5000" MaximumTimeout="30000" ProduceDumps="true">
This will write up to 10 "full" dump files. Once a dump file is written, you can zip it with the logs and mail it to us with a description of the issue. In most cases, we will get in touch with you to get more information and solve the case.