Photon Server設定ファイルの設定
インスタンス
複数のインスタンスに対応しています。コンフィグファイル内に、各インスタンス独自のノードが格納されています。
| 設定 | Photonのデフォルト | コンフィグのデフォルト | 詳細 | | --- | --- | --- | --- | | ConfigName | – | – | コンフィグファイル内の "ConfigName" 値(任意)。存在する場合はログされます。| | ReportOnJob | – | FALSE | Win32ジョブオブジェクト内で実行されているかどうかを判定し、実行されている場合は現在適用されている制限内容を報告します。| | LogFileLocation | – | | ログファイルへのパスを設定します。デフォルトではサーバーが開始される場所になっています。絶対パス、または PhotonSocketServer.exe からの相対パスを指定できます。| | EnablePerformanceCounters | – | TRUE | サーバーがパフォーマンスカウンタを有効にするかを判定します。この実装では共有メモリセグメントを作成するため、適切な権限が必要です。権限なしで実行するには、「false」に設定します。| | MaxMessageSize | – | 512000 | UDP、TCP、またはWebSocketsメッセージの最大数。これを超過すると、クライアントは切断されます。適切なリスナーで上書きできます。| | ShutdownTimeout | – | 30000 | この時間内(ミリ秒, ms)にPhotonのシャットダウンが完了しない場合、プロセスは強制終了されます。| | DisplayName | – | – | Photon Controlで表示されるこのインスタンスの表示名(任意)。|TCP
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | TCPBufferSize | – | 4096 | TCPデータ送信に使用するバッファのサイズ。メッセージサイズは制限されません。平均メッセージサイズよりも少し高い設定にしておくことが理想です。| | TCPBufferAllocatorPoolSize | – | 500 | 後から再利用するためにプールに保管されているTCPデータの送信に使用されるバッファの数。速度とリソース消費のトレードオフです。| | StreamSocketAllocatorPoolSize | – | 250 | 後から再利用するために保管されているTCPソケットの数。速度とリソース消費のトレードオフです。|UDP/ENet
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | DatagramSocketAllocatorPoolSize | – | 1000 | 後から再利用するためにプールに保管されているデータグラムソケットの数。速度とリソース消費のトレードオフです。 | | PingIntervalMilliseconds | – | 1000 | データが流れていない場合に、サーバーからクライアントにpingが送信される頻度。値を大きくすると、サーバー負荷が低減されます。デフォルトでは、ENetの標準値500msが設定されています。| | DataSendingDelayMilliseconds | 5 | 5 | 送信前のデータ蓄積のためにサーバーが待機する時間。値を大きくすると、データグラム数は減少しますが、レイテンシは増加します。| | AckSendingDelayMilliseconds | 5 | 5 | データパケットに便乗して送信できるようにACKの送信前にサーバーが待機する時間。レイテンシは増加しません。 | | ENETBufferAllocatorPoolSize | – | 5000 | 後から再利用するためにプールに保管されているバッファの数。速度とリソース消費のトレードオフです。 | | ValidateCRCifPresent | – | FALSE | If enabled, incoming datagrams with an optional CRC value will have their checksum validated. Outbound datagrams to peers created with CRC will also include the CRC value. | | MinimumTimeout | 5000 | 5000 | Minimum time before an ENet peer's lack of response causes a timeout disconnect. Actual time is determined dynamically per peer based on RTT history. | | MaximumTimeout | 30000 | 30000 | Maximum time before an ENet peer's lack of response causes a timeout disconnect. Actual time is determined dynamically per peer based on RTT history. | | MinimumRetransmitTimeout | 200 | – | Sets a minimum retransmission time. Low-latency peers may be delayed. Reduces retransmission speed and server load. | | MaximumRetransmitTimeout | 0 | – | Defines the maximum retransmission time. 0 = feature is turned off. | | RTTACKAdjustmentTimeout | 0 | – | When set, the last retransmit-timeout is used (fast resend) instead of last retransmit-timeout×2 if the peer received any data during the period. 0 = feature is turned off. |UDP/ENet Throttling
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | PerPeerMaxReliableDataInTransit | 51200 | 16384 | Maximum amount of reliable data (in bytes) a peer can have in-flight without ACK. Once reached, future reliable data is queued. | | PerPeerTransmitRateLimitKBSec | 256 | 256 | Maximum data (reliable + unreliable) that can be sent per second (in KB). When reached, reliable data is queued and unreliable data is dropped. | | PerPeerTransmitRatePeriodMilliseconds | – | 200 | How often the transmit rate limit is checked. Smaller = smoother flow; larger = less server resources used. | | MaxQueuedDataPerPeer | 512000 | 163840 | Maximum amount of reliable data a peer can queue. Once exceeded, future reliable sends return an error code. |Debugging
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | ProduceDumps | – | TRUE | Enable or disable creation of dump files in case of a crash. Dump files are essential to find issues in the Photon Core. | | DumpType | – | Full | Type of crash dumps: "Full", "Maxi", or "Mini". Less information from first to last but also less disk space. | | MaxDumpsToProduce | – | 10 | Maximum number of dump files written. If files are moved or deleted, new ones can be written. |IOPool
Handles all I/O operations such as datagram sending/reception, TCP read completions, etc. Can also handle ENet protocol operations if ENetThreadPool\OnlyDispatchTimers is "true".
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | NumThreads | – | 2 | Number of threads for socket I/O. 4–8 tends to be good. If set to 0, uses 2× the number of CPU cores. |ThreadPool
The "Business Logic" thread pool used for all CLR operations.
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | InitialThreads | – | 4 | Number of threads the thread pool starts with. | | MinThreads | – | 4 | Minimum number of threads in the pool. | | MaxThreads | – | 4 | Maximum number of threads. If Initial, Min, and Max are the same, the pool is static (more efficient). Dynamic pools grow and shrink as demand changes. | | MaxDormantThreads | – | 4 | Maximum number of dormant (idle) threads. Excess threads will be shut down. | | PoolMaintPeriod | – | 5000 | How often (in ms) the pool is maintained to check on and shut down dormant threads. | | DispatchTimeout | – | 100 | If a work item is dispatched and this many milliseconds pass before a worker picks it up, a new thread may be started. |ENetThreadPool
Used for all ENet protocol operations: deblocking inbound datagrams, ACK handling, retransmission, and ping generation.
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | InitialThreads | – | 2 | ThreadPoolを参照してください。 | | MinThreads | – | 2 | ThreadPoolを参照してください。 | | MaxThreads | – | 2 | ThreadPoolを参照してください。 | | MaxDormantThreads | – | 5 | ThreadPoolを参照してください。 | | PoolMaintPeriod | – | 5000 | ThreadPoolを参照してください。 | | DispatchTimeout | – | 100 | ThreadPoolを参照してください。 | | OnlyDispatchTimers | – | FALSE | If true, only ENet timer operations use this pool. If false, all ENet protocol operations are dispatched to this pool. |Runtime
Defines the Photon Runtime behavior.
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | Assembly | PhotonHostRuntime, Culture=neutral | – | The Photon Runtime assembly to use. MUST be signed by the Exit Games Photon Runtime key. PublicKeyToken must NOT be specified. | | CLRVersion | – | – | By default, the latest .NET runtime is used. Per instance, allows loading a specific version (e.g. "v4.0" or "v2.0"). | | EnableMDA | – | FALSE | Enables managed debugging assistants. Configure with a PhotonSocketServer.exe.mda.config file. | | Type | PhotonHostRuntime.PhotonDomainManager | | The type used as the domain manager. MUST derive from IPhotonDomainManager. | | UnhandledExceptionPolicy | Ignore | Ignore | Options: Ignore, ReloadAppDomain, TerminateProcess. |Applications
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | Default | – | – | A default application to use if no application is specified. | | PassUnknownAppsToDefaultApp | – | TRUE | If true, unknown application names use the default app. If false, it's a fatal error terminating the connection. |Application
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | Name | – | – | Arbitrary name for the application, used for dispatch. | | SharedDirectory | – | "Shared" | Contains shared assemblies. Located under the Base Directory. | | BaseDirectory | – | – | Should contain a "bin" folder with all assemblies, config files, etc. | | Assembly | – | – | Details of the assembly to use. Can contain a complete assembly specification string including PublicKeyToken. | | Type | – | – | The type loaded as the application. MUST derive from IPhotonApplication. | | EnableShadowCopy | – | FALSE | If enabled, the CLR creates copies of assembly files in a private directory, allowing originals to be overwritten for updates. | | EnableAutoRestart | – | FALSE | If enabled, the app restarts automatically on file changes. Existing connections continue until all disconnect, then the old app domain is unloaded. | | ForceAutoRestart | TRUE | FALSE | Implies EnableAutoRestart but aborts all existing connections rather than waiting for them to disconnect. | | RestartDelayMilliseconds | – | 1000 | File-change restarts can be delayed with this setting. | | WatchFiles | – | "" | No entry means watch everything. Example: `WatchFiles="dll;config;Lite.XML"` | | ExcludeFiles | – | "" | No entry means exclude nothing. Example: `ExcludeFiles="log4net.config"` | | StartTimeoutMilliseconds | – | 0 | Photon shuts down if the app doesn't start in time. 0 = no timeout. | | StopTimeoutMilliseconds | – | 0 | Photon shuts down if the app doesn't stop in time. 0 = no timeout. |TCPListener
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | IPAddress | 0.0.0.0 | – | リッスンするIPアドレス。 0.0.0.0は全てのインターフェイスを意味します。 | | IPAddressIPv6 | :: | – | The リッスンするIPv6アドレス。. :: は全てのインターフェイスを意味します。 | | Port | 4530 | 4530 | リッスンするポート。 | | ListenBacklog | – | 150 | Size of the listen backlog queue. Affects simultaneous connection establishment, not active concurrent connections. | | RecvBufferSize | – | 0 | TCP recv buffer size (also determines TCP window size). 0 = use OS default. | | SendBufferSize | – | 0 | TCP send buffer size. 0 = use OS default. | | MaxPendingWrites | – | 50 | Flow control: max pending write buffers. | | MaxQueuedBuffers | – | 200 | Flow control: max queued write buffers. More than pending writes reduces non-paged pool usage. | | DisableNagle | TRUE | TRUE | If true, Nagle is disabled and outbound TCP data is sent immediately. May improve latency at the expense of more datagrams. | | InactivityTimeout | 5000 | 5000 | Time (ms) allowed between receiving data. Exceeded = connection aborted. 0 = disabled. | | DisconnectTimeout | – | 120000 | Time (ms) allowed for the client to close the connection after being disconnected by the application. | | OverrideApplication | – | – | Override the application for this connector. Client-sent application selection is ignored. | | DefaultApplication | – | – | Default application for this listener if a client connects to an unloaded app. Overrides the global Default. | | PolicyApplication | – | – | Application used for policy requests sent to this listener. | | MaxInboundMessageSize | – | – | Max bytes for an inbound message. Exceeding disconnects the client. Default is MaxMessageSize. | | MaxOutboundMessageSize | – | – | Max bytes for an outbound message. Exceeding disconnects the client. Default is MaxMessageSize. | | CustomConnectMessageIsRequired | – | FALSE | If true, a custom prefix/suffix is required on each Connect message. | | CustomConnectMessagePrefix | – | – | String ignored if sent as a prefix of a client's connect message. | | CustomConnectMessageSuffix | – | – | String ignored if sent as a suffix of a client's connect message. |UDPListener
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | IPAddress | 0.0.0.0 | – | リッスンするIPアドレス。 0.0.0.0は全てのインターフェイスを意味します。 | | IPAddressIPv6 | :: | – | The リッスンするIPv6アドレス。:: は全てのインターフェイスを意味します。 | | Port | 5055 | 5055 | リッスンするポート。 | | ListenBacklog | – | 500 | TCPListenerを参照してください。 | | RecvBufferSize | – | – | TCPListenerを参照してください。 | | SendBufferSize | – | – | TCPListenerを参照してください。 | | OverrideApplication | – | – | TCPListenerを参照してください。 | | DefaultApplication | – | – | TCPListenerを参照してください。 | | MaxInboundMessageSize | – | – | TCPListenerを参照してください。 | | MaxOutboundMessageSize | – | – | TCPListenerを参照してください。 |WebSocketListener
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | IPAddress | 0.0.0.0 | – | リッスンするIPアドレス。 0.0.0.0は全てのインターフェイスを意味します。 | | IPAddressIPv6 | :: | – | リッスンするIPv6アドレス。::は全てのインターフェイスを意味します。| | Port | – | 9091 | リッスンするポート。 | | ListenBacklog | – | – | TCPListenerを参照してください。 | | RecvBufferSize | – | – | TCPListenerを参照してください。 | | SendBufferSize | – | – | TCPListenerを参照してください。 | | DisableNagle | TRUE | TRUE | TCPListenerを参照してください。 | | InactivityTimeout | 10000 | 10000 | TCPListenerを参照してください。 | | OverrideApplication | – | – | TCPListenerを参照してください。 | | DefaultApplication | – | – | TCPListenerを参照してください。 | | MaxInboundMessageSize | – | – | TCPListenerを参照してください。 | | MaxOutboundMessageSize | – | – | TCPListenerを参照してください。 | | MaxPendingWrites | – | – | TCPListenerを参照してください。 | | MaxQueuedBuffers | – | – | TCPListenerを参照してください。 | | DisconnectTimeout | – | – | TCPListenerを参照してください。 |SSL
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | Secure | | FALSE | SSLでリスナーを保護するにはtrueに設定します。| | StoreName | – | MY | 証明書ストア名。 | | CertificateName | – | Photon | 使用する証明書の名前。| | UseMachineStore | – | FALSE | マシンストアを使用するかどうかを指定します。|TCPPolicyListener
備考: TCPFlashListener は非推奨です。代わりに TCPPolicyListener を使用してください。
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | Address | – | – | リッスンするIPアドレス。 0.0.0.0は全てのインターフェイスを意味します。 | | Port | – | 943 | リッスンするポート。 | | Application | – | – | このリスナーのアプリケーションを定義します。| | ListenBacklog | – | – | TCPListenerを参照してください。 | | InactivityTimeout | – | 1000 | TCPListenerを参照してください。 |ConfigServer
設定されている場合、Telnet クライアントに対してテキストメニューインターフェイスを提供するリスナーを構成します。このインターフェイスを使用して、アプリケーションの管理やサーバーのシャットダウンを行えます。
| 設定 | Photonデフォルト | コンフィグデフォルト | 詳細 | | --- | --- | --- | --- | | IPAddress | – | – | リッスンするIPアドレス。 0.0.0.0 は全てのインターフェイスを意味します。| | Port | – | – | リッスンするポート。| | ListenBacklog | – | – | TCPListenerを参照してください。 |