This document is about: SERVER 5
SWITCH TO

5.0 BETA to 5.0 RC1 Update Guide

Overview of Major Changes

This guide is for updating from v5.0 BETA to v5.0 RC1.
Other than CounterPublisher (App, Project and DLLs) being deprecated and removed from SDK, there are mainly configuration changes.

PhotonServer.config Changes

  • We now recommend using the new syntax for defining server application instances:
    Instead of:

    XML

    <Configuration>
      <LoadBalancing>
      </LoadBalancing>
    </Configuration>
    

    Do:

    XML

    <Configuration>
      <Instance Name="LoadBalancing">
      </Instance>
    </Configuration>
    

HTTP Listeners

WebSocketListeners (and other HTTP listeners) have changed syntax.

Before (v5 BETA):

XML

    <WebSocketListeners>
      <WebSocketListener
        IPAddress="0.0.0.0"
        Port="9090"
        DisableNagle="true"
        InactivityTimeout="10000"
        OverrideApplication="Master">
      </WebSocketListener>
      <WebSocketListener
        IPAddress="0.0.0.0"
        Port="9091"
        DisableNagle="true"
        InactivityTimeout="10000"
        OverrideApplication="Game">
      </WebSocketListener>
    </WebSocketListeners>

After (v5):

XML

    <HTTPListeners>
      <HTTPListener
        Name="*:[PORT]::Master"
        IPAddress="0.0.0.0"
        Port="9090"
        DisableNagle="true"
        InactivityTimeout="10000">
        <Routing>
          <Route 
            Url="/+" 
            OverrideApplication="Master"
            PeerType="WebSocket"
            Counters="false" />
          <Route Url="/photon/m" Ping="true" Counters="false"/>
        </Routing>
      </HTTPListener>
      <HTTPListener
        Name="*:[PORT]::Game"
        IPAddress="0.0.0.0"
        Port="9091"
        DisableNagle="true"
        InactivityTimeout="10000"
        AppDataInactivityTimeout="15000">
        <Routing>
          <Route 
            Url="/+" 
            OverrideApplication="Game"
            PingEvery="2000" 
            PeerType="WebSocket"
            Counters="false" />
          <Route Url="/photon/g" Ping="true" Counters="false"/>
        </Routing>
      </HTTPListener>
      <HTTPListener
        Name="*:[PORT]::NameServer"
        IPAddress="0.0.0.0"
        Port="9093"
        DisableNagle="true"
        InactivityTimeout="10000"
        AppDataInactivityTimeout="15000">
        <Routing>
          <Route 
            Url="/+" 
            OverrideApplication="NameServer"
            PeerType="WebSocket"
            Counters="false" />
          <Route Url="/photon/n" Ping="true" Counters="false"/>
        </Routing>
      </HTTPListener>
    </HTTPListeners>

LoadBalancing Configuration Changes

File Name Changes

First, the most noticebale difference is that now each server application has its own configuration file that has the following name format: "{application_name}.xml.config".
This is important especially for Master and GameServer applications that used to share the same file name and content by default: "Photon.LoadBalancing.dll.config".
The content of that file is now split into two files:

  • "deploy\LoadBalancing\Master\bin\Master.xml.config"
  • "deploy\LoadBalancing\GameServer\bin\GameServer.xml.config"

Here is the list of the configuration files:

Master

Before (v5 BETA):

"deploy\LoadBalancing\Master\bin\Photon.LoadBalancing.dll.config"

After (v5):

"deploy\LoadBalancing\Master\bin\Master.xml.config"

GameServer

Before (v5 BETA):

"deploy\LoadBalancing\GameServer\bin\Photon.LoadBalancing.dll.config"

After (v5):

"deploy\LoadBalancing\GameServer\bin\GameServer.xml.config"

NameServer

Before (v5 BETA):

"deploy\NameServer\bin\Photon.NameServer.dll.config"

After (v5):

"deploy\NameServer\bin\NameServer.xml.config"

Structure Change

The second important change is that configuration files have a new structure.

Old file structure:

XML

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- sections defined here -->
  </configSections>
  <applicationSettings>
     <!-- app settings -->
  </applicationSettings>
  <!-- other settings -->
  <startup>
  </startup>
</configuration>

New file structure:

XML

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <Photon>
    <!-- all settings here -->
  </Photon>
</configuration>

Notice the root <Photon> element.

Some of the old configuration sections (XML elements) are no longer needed:

  • <configSections>
  • <applicationSettings>
  • <startup>
  • <runtime>
  • <CounterPublisher>

Some elements have been renamed:

  • <Photon.LoadBalancing.Common.CommonSettings> is now <LoadBalacing>
  • <Photon.Common.Authentication.Settings> is now <Authentication>
  • <Photon.LoadBalancing.MasterServer.MasterServerSettings> is now <Master>
  • <Photon.LoadBalancing.GameServer.GameServerSettings> is now <GameServer>
  • <Photon.NameServer.Settings> is now <NameServer>
  • <WebRpcSettings> is now <WebRpc>
  • <AuthSettings> is now <CustomAuth>

Also now each setting node has a custom name matching the setting instead of the old generic format.
This applies to all elements except <WebRPC> (previously <WebRpcSettings>) and <CustomAuth> (previously <AuthSettings) which did not change.

Old setting node format:

XML

<setting name="SettingName" serializeAs="String">
    <value>SettingValue</value>
</setting>

New setting node format:

XML

<SettingName>SettingValue</SettingName>

Here is a more detailed breakdown of the changes per file:

Master

Old file structure:

XML

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- sections defined here -->
  </configSections>
  <applicationSettings>
    <Photon.LoadBalancing.Common.CommonSettings>
    </Photon.LoadBalancing.Common.CommonSettings>
    <Photon.Common.Authentication.Settings>
    </Photon.Common.Authentication.Settings>
    <Photon.LoadBalancing.MasterServer.MasterServerSettings>
    </Photon.LoadBalancing.MasterServer.MasterServerSettings>
  </applicationSettings>
  <Photon>
    <CounterPublisher>
    </CounterPublisher>
  </Photon>
  <WebRpcSettings>
  </WebRpcSettings>
  <startup>
  </startup>
</configuration>

New file structure:

XML

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <Photon>
    <LoadBalancing>
    </LoadBalancing>
    <Authentication>
    </Authentication>
    <Master>
      <S2S>
      </S2S>
      <GS>
      </GS>
      <Limits>
        <Inbound>
        </Inbound>
        <Lobby>
        </Lobby>
      </Limits>
    </Master>
    <WebRpc>
      <HttpQueueSetting>
      </HttpQueueSettings>
    </WebRpc>
  </Photon>
</configuration>

GameServer

Old file structure:

XML

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- sections defined here -->
  </configSections>
  <applicationSettings>
    <Photon.LoadBalancing.Common.CommonSettings>
    </Photon.LoadBalancing.Common.CommonSettings>
    <Photon.Common.Authentication.Settings>
    </Photon.Common.Authentication.Settings>
    <Photon.LoadBalancing.MasterServer.GameServerSettings>
    </Photon.LoadBalancing.MasterServer.GameServerSettings>
  </applicationSettings>
  <Photon>
    <CounterPublisher>
    </CounterPublisher>
  </Photon>
  <WebRpcSettings>
  </WebRpcSettings>
  <startup>
  </startup>
</configuration>

New file structure:

XML

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <Photon>
    <LoadBalancing>
    </LoadBalancing>
    <Authentication>
    </Authentication>
    <GameServer>
      <S2S>
      </S2S>
      <Master>
      </Master>
      <Limits>
        <Inbound>
          <EventCache>
          </EventCache>
          <Properties>
          </Properties>
          <Operations>
          </Operations>
        </Inbound>
      </Limits>
      <HttpQueueSetting>
      </HttpQueueSettings>
    </GameServer>
    <WebRpc>
      <HttpQueueSetting>
      </HttpQueueSettings>
    </WebRpc>
  </Photon>
</configuration>

NameServer

Change (Rename / Replace) <AuthSettings> node to <CustomAuth> while keeping the same attributes/properties' values.

Old file structure:

XML

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- sections defined here -->
  </configSections>
  <applicationSettings>
    <Photon.NameServer.Settings>
    </Photon.NameServer.Settings>
    <Photon.Common.Authentication.Settings>
    </Photon.Common.Authentication.Settings>
  </applicationSettings>
  <AuthSettings>
  </AuthSettings>
  <startup>
  </startup>
  <runtime>
  </runtime>
</configuration>

New file structure:

XML

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <Photon>
    <NameServer>
    </NameServer>
    <Authentication>
    </Authentication>
    <CustomAuth>
      <HttpQueueSetting>
      </HttpQueueSettings>
    </CustomAuth>
  </Photon>
</configuration>

Plugins

Add a <Configuration></Configuration> enclosing wrapper element as follows:

XML

<Configuration>
  <PluginSettings Enabled="True">
    <Plugins>
      <!-- custom plugin settings here -->
    </Plugins>
  </PluginSettings>
</Configuration>

HttpQueueSettings

HttpQueue is used for everything HTTP (outbound).
So it made sense to group the queue's related settings into one group.
This group of settings is used in GameServer, WebRPC and CustomAuth settings (as a subgroup).
Most of the settings were already available in v4 but now it's more organized (new structure), clean and consistent (naming).

  • HttpRequestTimeout: How long (in milliseconds) the queue can wait for a HTTP response.
  • LimitHttpResponseMaxSize: Maximum size allowed for HTTP response payload.
  • MaxBackoffTime: Backoff threshold when retrying to send a HTTP request.
  • MaxConcurrentRequests: Maximum concurrent HTTP requests allowed.
  • MaxErrorRequests: Maximum number of errors that can occur while processing queued requests.
    If reached the HttpQueue will disconnect (clear all queued requests and reject incoming) and then resume after ReconnectInterval.
  • MaxQueuedRequests: Maximum number of requests that can be queued.
  • MaxTimedOutRequests: Maximum number of requests that timeout in the queue waiting to be processed.
    If reached the HttpQueue will disconnect (clear all queued requests and reject incoming) and then resume after ReconnectInterval.
  • QueueTimeout: If a request stays in the HttpQueue for QueueTimeout milliseconds it will be removed automatically.
  • ReconnectInterval: How long (in milliseconds) the queue needs to wait before resuming process of HTTP requests.

LoadBalancer and Workload Configuration Changes

Workload Configuration Change

Old structure:

XML

<?xml version="1.0" encoding="utf-8" ?>
<FeedbackControlSystem>
  <FeedbackControllers>
      <!-- one or more controllers setup -->
  </FeedbackControllers>
</FeedbackControlSystem>

New structure (wrapper <Configuration></Configuration> element/node added):

XML

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <FeedbackControlSystem>
    <FeedbackControllers>
      <!-- one or more controllers setup -->
    </FeedbackControllers>
  </FeedbackControlSystem>
</Configuration>

LoadBalancer Configuration Change

The LoadBalancer configuration file is "deploy\LoadBalancer.config".

XML

<?xml version="1.0" encoding="utf-8" ?>
  <LoadBalancer ReserveRatio="{ReserveRatio}" ValueUp="{ValueUp}">
    <LoadBalancerWeights>
      <Level name="0" Level="Level0" Value="{Value0}" />
      <Level name="1" Level="Level1" Value="{Value1}"/>
      <Level name="2" Level="Level2" Value="{Value2}"/>
      <Level name="3" Level="Level3" Value="{Value3}"/>
      <Level name="4" Level="Level4" Value="{Value4}"/>
      <Level name="5" Level="Level5" Value="{Value5}"/>
      <Level name="6" Level="Level6" Value="{Value6}"/>
      <Level name="7" Level="Level7" Value="{Value7}"/>
      <Level name="8" Level="Level8" Value="{Value8}"/>
      <Level name="9" Level="Level9" Value="{Value9}"/>
    </LoadBalancerWeights>
  </LoadBalancer>

New structure (wrapper <Configuration></Configuration> element/node added):

XML

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <LoadBalancer ReserveRatio="{ReserveRatio}" ValueUp="{ValueUp}">
    <LoadBalancerWeights>
      <Level name="0" Level="Level0" Value="{Value0}" />
      <Level name="1" Level="Level1" Value="{Value1}"/>
      <Level name="2" Level="Level2" Value="{Value2}"/>
      <Level name="3" Level="Level3" Value="{Value3}"/>
      <Level name="4" Level="Level4" Value="{Value4}"/>
      <Level name="5" Level="Level5" Value="{Value5}"/>
      <Level name="6" Level="Level6" Value="{Value6}"/>
      <Level name="7" Level="Level7" Value="{Value7}"/>
      <Level name="8" Level="Level8" Value="{Value8}"/>
      <Level name="9" Level="Level9" Value="{Value9}"/>
    </LoadBalancerWeights>
  </LoadBalancer>
</Configuration>
Back to top