Photon——Setup and Config 设置与配置
生活随笔
收集整理的這篇文章主要介紹了
Photon——Setup and Config 设置与配置
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
?
Setup and Config 設(shè)置與配置
This chapter explains how files and folders are organized for the Photon Server and how things are setup. Everything needed is in the deploy folder. 這章解釋了在服務(wù)器上文件和文件夾是如何被組織和配置的。?????Content 內(nèi)容
-
- Organization of Server and Applications?組織服務(wù)器與應(yīng)用程序
- Configuration: PhotonServer.config?配置PhotonServer.config
- The Application Node?應(yīng)用程序節(jié)點
- UDPListeners and TCPListeners Nodes?UDP監(jiān)聽和TCP監(jiān)聽節(jié)點
- TCPSilverlightListeners and TCPFlashListeners Nodes?TCP的Silverlight和Flash的監(jiān)聽節(jié)點
- Timeout Settings?超時設(shè)置
- Send Delay and Ack Delay?發(fā)送延遲和Ack延遲
?????Organization of Server and Applications 組織服務(wù)器與應(yīng)用程序
There are four versions of Photon in the folders: “bin_Win32”, “bin_x64”, “bin_Win32_xp” and “bin_win64_xp”. We refer to these as binaries-folders. 在文件夾中這有不同版本的Photon:“bin_Win32”, “bin_x64”, “bin_Win32_xp” and “bin_win64_xp”,我選擇需要使用的那個二進制文件夾。 Photon requires a separate folder next to the binaries-folder per application (e.g. “Lite” in the deploy folder). The assemblies must be in a “bin” subfolder (e.g. Lite/bin). Photon需要獨立的文件夾去存放應(yīng)用程序,程序集必須放在文件夾內(nèi)的Bin目錄下。 The following folders in the Server SDK deploy folder are applications: Lite, LiteLobby, MMO, CounterPublisher, Policy?Applications are setup in Photon’s config file, as explained below. 在服務(wù)器SDk?deploy?文件夾下的應(yīng)用程序有:?Lite, LiteLobby, MMO, CounterPublisher, Policy?Applications,被配置在Photon的配置文件中。 The bin_tools folder currently contains useful tools: bin_tools文件夾中有以下可用的工具:- Baretail:?Our favorite log viewer in the free edition. It is used by?PhotonControl?to view the latest logs.
- Photon Dashboard:?The service to collect and concentrate Dashboard Counters and display them on a webpage.
- Perfmon:?Contains a list of PerfMon counters used when you setup counter logging to a file. This is explained under “Administration”.
- Stardust:?A commandline testclient that can be used to get some load on a machine. This is shown in?Photon in 5 Minutes
?????Configuration: PhotonServer.config 配置PhotonServer.config
The main configuration file for Photon is the PhotonServer.config. An identical copy is located in each binaries-folder in the SDK. It is used to setup applications, listeners for IPs and performance specific values. It does not contain config values for the game logic. PhotonServer.config是Photon的主配置文件,在每個二進制文件夾中,它是用來配置應(yīng)用程序,監(jiān)聽器和性能值。他不能用來配置游戲邏輯的值。 The default values make sure Photon scales nicely on more cores but does not overwhelm a regular machine. In general performance tweaks are not needed. 這默認(rèn)值保證了Photon的兼容性,一般情況下性能不需要調(diào)整 The following settings are most commonly used. More options are described in the “photon-configuration.pdf”, located in the Server SDK. 以下是最常用的設(shè)置項,更多的設(shè)置請參看“photon-configuration.pdf”,在本地服務(wù)器的SDK中。?????The Application Node 應(yīng)用程序節(jié)點
The config file defines which applications Photon should load on startup. In the “Applications” node, several “Application” entries can be added. 配置文件定義了Photon將運行哪些應(yīng)用程序,在?“Applications”?節(jié)點中為每個應(yīng)用程序添加一個?“Application”節(jié)點。| ? | <ApplicationsDefault="Lite"> <!-- Lite Application --> <Application Name="Lite" BaseDirectory="Lite\Lite" Assembly="Lite" Type="Lite.LiteApplication" EnableAutoRestart="true" WatchFiles="dll;config" ExcludeFiles="log4net.config"> </Application> </Applications> |
?????UDPListeners and TCPListeners Nodes ?UDP監(jiān)聽和TCP監(jiān)聽節(jié)點
These configure UDP and TCP endpoints on your machine respectively. You can use either (e.g. only UDP) or both. 在你的機器上配置UDP和TCP的端口,你可以使用其中的一種或兩種。 The default IP 0.0.0.0 makes Phonton listen on any locally available IP. By replacing the wildcard IP, Photon will open only specific IPs and ports. Multiple UDPListener and TCPListener nodes can be defined, opening several IP/port combinations. 默認(rèn)IP是0.0.0.0,這使得Photon將監(jiān)聽所有的本地可用的IP。通過替換IP通配符,Photon將打開指定的IP和端口。可以定義多個UDPListener?和?TCPListener 節(jié)點來打開多組IP與端口組合。 Per UDPListener and TCPListener node, you can setup an OverrideApplication or DefaultApplication. Override means: any client that connects to this port will end up in the application named, no matter what the client connects to. Default is a fallback, in case the application named by a client is not found. 每個UDPListener 和 TCPListener 節(jié)點,你可以設(shè)置一個OverrideApplication 或 DefaultApplication。Override?的意義是:任意連接該端口的客戶端無論它連接到什么都將在已命名的應(yīng)用中結(jié)束,Default?是備用的,用在客戶端找不到已命名的應(yīng)用程序。| ? | <UDPListeners> <UDPListener IPAddress="0.0.0.0" Port="5055" OverrideApplication="Master"> </UDPListener> <UDPListener IPAddress="0.0.0.0" Port="5056" OverrideApplication="Game1"> </UDPListener> </UDPListeners> |
?????TCPSilverlightListeners and TCPFlashListeners Nodes ?TCP的Silverlight和Flash的監(jiān)聽節(jié)點
Could be removed but are needed when you create Silverlight or Flash games respectively. Both client-side plugins require a server to respond with a “policy file” (unless the website is on the same domain as Photon). 可以移除該配置,單當(dāng)你需要創(chuàng)建Silverlight 或 Flash 游戲時是需要的,客戶端請求服務(wù)器響應(yīng)一個policy文件(除非網(wǎng)站在同一個域內(nèi))?????Timeout Settings 超時設(shè)置
Two values in the instance node describe how the server times out unresponsive UDP clients:MinimumTimeoutandMaximumTimeout. 有兩個節(jié)點來描述服務(wù)器超時:MinimumTimeout?和?MaximumTimeout| ? | <Instance1 EnablePerformanceCounters="true" DataSendingDelayMilliseconds="50" AckSendingDelayMilliseconds="50" MinimumTimeout="5000" MaximumTimeout="30000”> ? |
?????Send Delay and Ack Delay 發(fā)送延遲和Ack延遲
The attributesDataSendingDelayMillisecondsandAckSendingDelayMillisecondsrepresent a tradeoff between performance and minimal response times. This delay directly adds some lag to reduce the bandwidth usage: the wait allows the server to aggregate commands and send them in one package. Thesenddelay is triggered when the server sends anything, theackdelay by incoming reliable data. 屬性DataSendingDelayMilliseconds?和?AckSendingDelayMilliseconds?代表了性能與最小響應(yīng)時間之間的權(quán)衡。這延遲減小了帶寬流量的使用:這等待允許服務(wù)器識別命令并用一個數(shù)據(jù)包發(fā)送他們。當(dāng)服務(wù)器進行發(fā)送時將觸發(fā)這個發(fā)送延遲,ack延遲是通過傳入可靠的數(shù)據(jù)。 As you can see above, the default values are 50ms each. We found this to be a good value but it causes a \~50ms roundtrip time, even if client and server run on the same machine. 正如你所看到的,這默認(rèn)值是50ms。我們發(fā)現(xiàn)它是一個很好的設(shè)置,在50ms內(nèi)進行一次往返,即使當(dāng)客戶端和服務(wù)器在同一臺機器上也是如此。 Depending on your game, you should load test with different values. A delay of 0 is a special case that skips usage of timers, so avoid low delays < 10. 你可以根據(jù)你的游戲,加載測試不同的值。0ms是一個特殊值用于跳過延遲,盡量避免延遲小于10ms轉(zhuǎn)載于:https://www.cnblogs.com/liusuqi/archive/2013/05/15/3079697.html
總結(jié)
以上是生活随笔為你收集整理的Photon——Setup and Config 设置与配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 类实现Java模板方法模式中的HookM
- 下一篇: 名为“ds”的+DataTable+已属