文章目錄
- Changing the “LoadBalancing IP Config” Path 更改“LoadBalancing IP Config” 的路徑
- Counters 計數器
- Dashboard 儀表板
- Troubleshooting 故障診斷
- Dump File Setup 轉儲檔案設定
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: 點擊系統托盤去開啟菜單:
啟動和停止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 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)
初始化效能監控器
啟動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: 以下是一個例子:
| |
<DefaultEnablePerformanceCounters = "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. 這將寫入完整的轉儲檔案。一旦轉儲檔案被寫入,你就可以壓縮它發送郵件給我們,在大多數情況下,我們會為你解答。