Photon——Photon Control 控制器
Photon Control Photon控制器
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.
Photon Control是一个针对Photon的一站式的可视化的控制软件,打开PhotonControl.exe不会出现windows窗口,不会启动服务,但会增加一个系统托盘,灰色的图标表示Photon不在运行,而蓝色的图标表示Photon正在运行。
Content 内容
-
- Overview 概述
- Running Photon 运行Photon
- Moving Photon 移动Photon
- Changing the “LoadBalancing IP Config” Path 改变“LoadBalancing IP Config”的路径
- Logs 日志
- Counters 计数器
- PerfMon Counters 性能监视器
- Dashboard Counters 仪表板计数器
- Dashboard 仪表板
- Troubleshooting 故障诊断
- Dump File Setup 转储文件设置
Overview 概述
Click the icon to open the menu. It allows you to:
点击系统托盘去打开菜单:
- Start and stop Photon.
启动和停止Photon
- Install, start and stop Photon services.
初始化,启动,停止 Photon服务
- Change the game server config for LoadBalancing (MyCloud).
改变游戏服务器为LoadBalancing(MyCloud)
- Setup and open Photon’s Performance Monitor (PerfMon) Counters.
设置并打开Photon的性能监视器
- 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.
需要管理员权限才能启动Photon Control,配置防火墙使Photon服务可用。当Photon Control启动时会读取许可证来设置Photon的版本,显示在Photon Control的菜单上,设置“Autostart Photon Control” 选项可以在登录系统时自动启动Photon Control。这是非常方便的去远程访问一个机器,并且可以通过 “Explore Working Path”找到Photon的文件,如果图标不可见,点击小三角拖放该图标到托盘上。
Running Photon 运行Photon
By default, two separate Photon configurations (also called “Instances”) are available. Each starts a combination of server applications and used ports. The “Default” instance is running Lite, LiteLobby, MMO and the Policy Application. Starting instance “LoadBalancing (MyCloud)” will run a Master Server and two Game Servers, which is a minimum Photon Cloud compatible setup.
默认情况下,有两种独立的Photon配置是可用的,每个可以启动一个服务器应用程序和使用所需的端口,Default实例运行的是Lite、 LiteLobby、MMO 和 Policy Application。LoadBalancing (MyCloud) 实例运行的是一个主服务器和两个游戏服务器,这是一个最小的 Photon Cloud 兼容设置。
On a public server, Photon should run as service. This requires three steps in Photon Control:
在一个公共服务器上,Photon作为服务运行,需要以下三个步骤:
- Install the Photon service
初始化Photon服务
- Install the PerfMon Counters (they might prove useful)
初始化性能监视器
- Start Photon as service
启动Photon作为服务
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.
PerfMon Counters不是服务运行的必须条件,但是当Photon正在运行的时候他们不能被启用,所以要一开始就设置它,运行Photon为应用程序是本地开发的一种选择,当你注销时,Photon就会被关闭。
Moving Photon 移动Photon
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.
在你移动Photon从一个文件夹到另一个之前,你需要确认移除所有的服务,并且Photon Control是自动启动的,然后在新的地方再次初始化。
Changing the “LoadBalancing IP Config” Path 更改“LoadBalancing IP Config” 的路径
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 Control不能被广泛的修改,一些重要的设置可以在PhotonControl.exe.config里找到。当你的项目是基于LoadBalancing,但不是重命名的,“GameServerConfigPaths” 设置项可能是你需要的,GameServerConfigPaths 是一个以 ‘;’间隔的地址路径列表,路径相对于PhotonControl.exe所在的文件夹。
Logs 日志
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.
Photon会记录一些必要的信息到服务器的日志文件中。点击 “Open Logs” 可以看到所有过去12小时内的日志,当然,需要的话你可以打开更多的文件。
There are two “log” folders:
以下是2个日志文件夹:
- 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.
所有应用程序的日志是在deploy/log folder。任何的业务逻辑的记录都会填充到这个文件夹下的一个文件中。
- The server core’s log folder is where your running executable is (e.g. bin_win32/log). They contain anything instance and CLR (dotnet runtime) related.
服务器的核心日志文件夹在你运行的二进制目录之下的log文件夹内,其中包含了所有相关的实例和CLR
We use Log4Net in the logic layer. It can be configured extensively and proved very useful. Learn more about Log4Net here .
我们可以在逻辑层内使用Log4Net。它可以进行广泛的配置并已证明它是非常的有用。
Counters 计数器
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”.
Photon持续跟踪一些基本的值用作性能和错误分析。以下是两个已公布的独立的计数器:“PerfMon Counters” 和 “Dashboard Counters”。
PerfMon Counters 性能监视器
The PerfMon Counters are key values from the Photon Core. They track values like connected peers, package count, reliable UDP usage, bandwidth 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_<date>.blg
PerfMon Counters的值来自Photon Core。他们跟踪一些值,例如连接用户,包计数,可靠UDP的使用,带宽流量。这些计数器不能通过开发和访问PerfMon而被改变。PerfMon 是一个已经安装在windows上的图形化的工具用来创建一些性能图形。如果在一个较长的时间范围内PerfMon计数器被记录,Photon Control可能会设置和记录信息到文件里。 在“PerfMon Counters”里可以点击“Create Logging Set” 和“Start Logging”进行配置。日志放置在C:\PerfLogs\Admin\photon_perf_log_<date>.blg。
Dashboard Counters 仪表板计数器
The Dashboard Counters track values within the business logic and can be extended as needed.
仪表板计数器是在业务逻辑中跟踪数值的。
Dashboard 仪表板
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. Lite has several pre-defined Counters ready to use.
仪表板收集计数器的值,并且在Web上生成图形用于监控它们。当Photon运行的时候仪表板可以作为服务进行初始化。应用程序的计数器数据的发布取决于应用程序里的定义。Lite里包含有多个预定义的计数器可以使用。
Troubleshooting 故障诊断
If Photon does not behave as expected, always have a look at the logs.
如果Photon不是像预期的那样,可以看一下日志。
These are the most common pitfalls you should check as well.
以下是最常见的错误,你需要检查一下
- Missing DotNet 3.5: In this case, Photon can’t start. Don’t mix this up with the CLR Version. The 2.0 CLR version is also used by DotNet 3.5.
缺少DotNet运行环境
- 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.
应用引用的SDK版本与服务器不一致。
- 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
延迟超过设置的值,默认为50ms
Dump File Setup 转储文件设置
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.
如果服务器崩溃了,日志中未能找到相关信息。Photon可以配置为转储文件。那些反应了状态和内存的信息是在调试中非常有用的。启用这个特性,你需要去编辑PhotonServer.config。设置“ProduceDumps”为True,并重启服务器。
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.
这将写入完整的转储文件。一旦转储文件被写入,你就可以压缩它发送邮件给我们,在大多数情况下,我们会为你解答。