This document is about: SERVER 5
SWITCH TO

4.x 에서 5.0 RC1으로 업그레이드 지침서

이 지침서는 v4에서 v5 또는 v5.0 RC1(v5 베타 아님) 그이상의 버전으로 마이그레이션에 대한 지침서입니다.

주요 변경 사항 개요

이전에 라이선스가 없었고 20개의 무료 CCU 부트스트랩 모드를 사용하여 서버를 실행 중이었다면, 새 서버 버전을 사용하려면 지금 라이선스를 받아야 합니다. CounterPublisher(앱, 프로젝트 및 DLL)는 더 이상 사용되지 않으며 SDK에서 제거되었습니다. 그 외에 몇 가지 구성 변경 사항을 검토해야 합니다.

라이선스 업데이트 및 업그레이드

새로운 주요 버전의 Photon SDK로 업그레이드하거나 새로 구입한 라이선스 파일과 함께 이전 버전의 SDK를 사용하는 경우, 프로덕션으로 들어가기 전에 해당 라이선스로 Photon SDK가 실행되는지 확인해야 합니다.

가장 쉬운 방법은 사용하려는 Photon SDK 폴더에 해당 라이선스 파일을 넣고 Photon Control 애플리케이션을 통해 Photon을 시작하는 것입니다. 그런 다음 트레이 앱에 표시된 라이선스 정보를 확인하고 추가로 로그에서 라이선스 오류가 있는지 확인해야 합니다.

코드 변경 사항

다음은 일반적으로 사용되는 일부 유형을 확장하는 사용자 지정 클래스에 필요한 변경 사항들입니다.

ApplicationBase

ApplicationBase 클래스를 확장해서 사용하고 있다면:

  • 생성자 중 하나가 IConfiguration 파라미터를 기본 생성자에 전달해야 합니다. 이렇게 하려면 NuGet 패키지 "Microsoft.Extensions.Configuration.Abstractions"를 임포트 해야 합니다. 그런 다음 XML 또는 JSON 또는 다른 곳에서 구성을 로드한 다음 기본 클래스 생성자에게 전달합니다. MasterApplication 또는 GameApplication 또는 PhotonApp 클래스에서 어떻게 하는지 보실 수 있습니다. 일반적인 패턴은 다음과 같습니다:

    C#

    using Photon.SocketServer;
    using Microsoft.Extensions.Configuration;
    
    public class CustomPhotonApplication : ApplicationBase
    {
        public CustomPhotonApplication() : base(LoadConfiguration())
        {
        }
    
        private static IConfiguration LoadConfiguration()
        {
    
  • (선택) 오버라이드해야 할 새로운 메소드:

    • object DecryptAuthToken(InitRequest initRequest, byte[] authToken, int offset, int length, out Dictionary<byte, object> encryptionData, out string errorMsg)
    • void OnWebRTCChannelDestroyed(IPhotonWebRTCPeer peer, object userData, byte channelId)

ClientPeer

ClientPeer 클래스를 확장해서 사용하고 있다면:

  • void OnUnexpectedDataReceived(byte[] data, string debugMessage)는 없어졌고 void OnDeserializationError(byte[] data, RtsMessageType msgType, string debugMessage, short errorCode = -12, byte code = 0, Exception exception = null)로 대체되었습니다.
  • OnDisconnected의 첫 번째 파라미터가DisconnectReason 에서 int로 변경 됨: 이전: void OnDisconnect(DisconnectReason reasonCode, string reasonDetail) 이후: void OnDisconnect(int reasonCode, string reasonDetail)
  • (선택) 오버라이드해야 할 새로운 메소드:
    • string GetHistograms()
    • void OnEncryptionQueueOverload(EncryptionQueueFailureParams failureParams)

S2SPeerBase

ClientPeer에서 확장할 때와 동일하고 오버라이드 해야 할 새로운 메소드 추가됨: void OnDisconnectMessage(DisconnectMessage message).

InboundS2SPeer

S2SPeerBase를 확장할 때와 동일.

OutboundS2SPeer

S2SPeerBase확장할 때와 동일하고 오버라이드 해야 할 새로운 메소드 추가됨 void OnConnectionEstablished(InitV3Response initResponse).

PhotonServer.config 변경 사항

  • 이제 서버 애플리케이션 인스턴스를 정의하는 새로운 구문을 지원합니다. 대신 다음을 사용합니다:

    XML

    <Configuration>
      <InstanceName>
      </InstanceName>
    </Configuration>
    

    아래와 같이 추가:

    XML

    <Configuration>
      <Instance Name="InstanceName">
      </Instance>
    </Configuration>
    
  • LoadBalancing 인스턴스의 경우 이제 기본 애플리케이션은 NameServer이며 v4에서처럼 Master가 아닙니다.

  • 로드 밸런싱 인스턴스에서 CounterPublisher 애플리케이션 노드를 제거합니다.

  • MMO 인스턴스를 제거합니다.

이전 설정

v5에서 제거된 일부 설정이 있으며 새로 도입된 스키마 유효성 검사로 인해 이러한 설정이 여전히 있으면 서버를 시작하지 못합니다.

애플리케이션

  • 공유 디렉토리 로직은 이전의 것으로 지금은 사용되지 않습니다. 관련 설정 제거:
    • SharedDirIsExeDir

애플리케이션

  • 공유 디렉토리 로직은 이전의 것으로 지금은 사용되지 않습니다. 관련 설정 제거:
    • SharedDirIsExeDir
    • SharedDirectory
  • 변경 시 애플리케이션 자동 재시작은 이제 사용하지 않습니다. 관련 설정 제거:
    • RestartDelayMilliseconds
    • WatchFiles
    • ExcludeFiles
    • EnableShadowCopy
    • EnableAutoRestart
    • ForceAutoRestart
  • Resolver
  • EnableOutboundENet

TCPListener

  • 인증서 설정이 변경되었으며 여기에서 자세히 살펴보세요. 이전 인증 설정은 없어졌습니다:
    • StoreName
    • UseMachineStore
    • CertificateName
  • DisconnectTimeout
  • MaxQueuedBuffers
  • MaxPendingWrites
  • FlowControlNotificationStepSize
  • PolicyApplication

HTTPListener

  • Access-Control-Allow-Origin

인스턴스

  • AttachConsole
  • TCPUsePageAllocator
  • UseStandardAllocator
  • UseLockFreeAllocator
  • UseTLSAllocator
  • ENETUseLowContentionBufferAllocator
  • ENETNumAllocators
  • ENETUsePageAllocator
  • ValidateCRCifPresent

IOPool / ENetIOPool / ENetThreadPool

"우선순위"설정이 모든 3개의 풀에서 없어졌습니다.

Runtime

  • OptimiseBroadcast 제거됨
  • UnhandledExceptionPolicy: "ReloadDomain" 을 "Ignore" 또는 "TerminateProcess" 로 값 교체됨. "ReloadDomain" 은 더 이상 지원되지 않습니다

HTTP 리스터

WebSocketListeners는 구문의 변경이 있습니다.

이전 (v4):

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>

이후 (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>

보안 리스너 설정

보안 채널(Schannel)에서 OpenSSL로 이동했기 때문에, 인증 형식과 보안 리스너의 환경 구성이 변경되었습니다.

  • 이전 속성 제거:
    • StoreName
    • UseMachineStore
    • CertificateName

인증 설정에 대한 새로운 설정으로 교체되었습니다. 인증 설정에 대해 더 알아보세요.

LoadBalancing 혼경 구성 변경 사항

파일 이름 변경

첫째, 가장 큰 차이점은 이제 각 서버 애플리케이션에 이름 형식이 "{application_name}.xml.config"인 자체 구성 파일이 있다는 것입니다. 이것은 특히 기본적으로 동일한 파일 이름("Photon.LoadBalancing.dll.config")과 콘텐츠를 공유하던 마스터 및 GameServer 애플리케이션의 경우 중요합니다. 이제 해당 파일의 내용이 두 개의 파일로 분할됩니다:

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

다음은 환경 구성 파일의 목록입니다:

Master

이전 (v4):

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

이후 (v5):

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

GameServer

이전 (v4):

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

이후 (v5):

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

플러그인

게임 서버 플러그인 환경 구성은 이제 GameSever 환경 구성 파일의 일부가 아니며, 이제 자체 파일인 "deploy\LoadBalancing\GameServer\bin\plugin.config"에서 이루어집니다. v4에서는 "deploy\LoadBalancing\GameServer\bin\Photon.LoadBalancing.dll.config" 내에서 사용되었기 때문에 여기에 있는 환경 구성 내용을 플러그인 환경 구성으로 옮겨야 합니다.

이전 (v4):

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

이후 (v5):

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

구조체 변경 사항

두 번째 중요한 변경 사항은, 환경 구성 파일이 새로운 구조체를 가지고 있다는 것입니다.

이전 파일 구조체:

XML

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

새로운 파일 구조체:

XML

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

루트 <Photon> 요소를 주목하세요.

이전의 환경 구성 섹션 (XML 요소) 일부가 더 이상 필요하지 않습니다:

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

일부 요소는 이름이 변경되었습니다.

  • <Photon.LoadBalancing.Common.CommonSettings> 은 이제 <LoadBalacing>입니다.
  • <Photon.Common.Authentication.Settings> 은 이제 <Authentication>입니다.
  • <Photon.LoadBalancing.MasterServer.MasterServerSettings> 은 이제 <Master>입니다.
  • <Photon.LoadBalancing.GameServer.GameServerSettings> 은 이제 <GameServer>입니다.
  • <WebRpcSettings> 은 이제 <WebRpc>입니다.
  • <AuthSettings> 은 이제 <CustomAuth>입니다.

또한 각 설정 노드에는 이전 일반 형식 대신 설정과 일치하는 사용자 지정 이름이 있습니다. 이 사항은 변경 사항이 없는 <WebRPC> (이전 <WebRpcSettings>) 그리고 <CustomAuth> (이전 <AuthSettings)를 제외한 모든 요소에 적용됩니다.=

이전 설정 노드 형식:

XML

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

새로운 설정 노드 형식:

XML

<SettingName>SettingValue</SettingName>

다음은 파일당 변경 사항에 대한 자세한 설명입니다:

Master

<CustomAuth> (이전 <AuthSettings)는 MasterServer의 환경 구성의 일부가 아니며 NameServer ("deploy\NameServer\bin\NameServer.xml.config")에서 환경 구성이 수행됩니다.

이전 파일 구조체:

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>

새로운 파일 구조체:

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>
    <SocketServer>
      <S2S>
      </S2S>
    </SocketServer>
  </Photon>
</configuration>

GameServer

이전 파일 구조체:

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>

새로운 파일 구조체:

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>
    <SocketServer>
      <S2S>
      </S2S>
    </SocketServer>
  </Photon>
</configuration>

플러그인

<Configuration></Configuration> 래퍼 요소를 다음과 같이 추가했습니다:

XML

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

HttpQueueSettings

HttpQueue는 모든 HTTP(아웃바운드)에 사용됩니다. 따라서 대기열의 관련 설정을 한 그룹으로 묶는 것이 타당했습니다. 이 설정 그룹은 GameServer, WebRPC 및 CustomAuth에서 사용되었습니다. 대부분의 설정은 v4에서 이미 사용할 수 있었지만 이제는 보다 체계적이고(새로운 구조), 깔끔하고 일관된(네이밍) 기능을 제공합니다.

  • HttpRequestTimeout: 언제까지(밀리 초로) HTTP 응답을 대기할 수 있는지를 나타냄.
  • LimitHttpResponseMaxSize: HTTP 응답 페이로드에 허용되는 최대 크기
  • MaxBackoffTime: HTTP 요청을 다시 보낼 때의 백오프 임계값입니다.
  • MaxConcurrentRequests: 허용된 최대 동시 HTTP 요청 수
  • MaxErrorRequests: 대기 중인 요청을 처리하는 동안 발생할 수 있는 최대 오류 수 HttpQueue에 도달하면 연결이 끊어지고(대기 중인 모든 요청을 지우고 들어오는 요청을 거부함) ReconnectInterval이후 다시 재개합니다.
  • MaxQueuedRequests: 대기열에 넣을 수 있는 최대 요청 수
  • MaxTimedOutRequests: 처리 대기 중인 대기열에서 시간 초과된 최대 요청 수 HttpQueue에 도달하면 연결이 끊어지고(대기 중인 모든 요청을 지우고 들어오는 요청을 거부함) ReconnectInterval이후 다시 재개합니다.
  • QueueTimeout: 요청이 HttpQueue에서 QueueTimeout 밀리초 동안 머물 경우 해당 요청은 자동으로 제거됩니다.
  • ReconnectInterval: HTTP 요청 프로세스를 재개하기 전에 대기열이 대기하는 시간(밀리초)입니다.

GameServer, WebRPC 또는 CustomAuth 노드의 이름이 같거나 비슷한 설정들은 제거되거나 <HttpQueueSettings> 요소 아래로 이동해야 합니다.

NameServer (신규)

v5에서 우리는 Photon 클라우드에 오직 전에 이용할 수 있는 NameServer 애플리케이션이라고 추가했습니다. 구성은 다음 두 가지 파일을 사용하여 수행됩니다:

  • 실제 애플리케이션 당 한 개의 파일입니다. 사용자 정의 인증 확인은 이제 NameServer에서 수행되고 더 이상 MasterServer에서 수행되지 않습니다. 따라서 이전에 구성된 사용자 정의 인증확인 설정을 MasterServer의 구성 파일(<AuthSettings>으로 부여된 섹션)에서 NameServer의 환경 구성 파일(<AuthSettings> 으로 부여된 섹션)로 이동합니다:"deploy\NameServer\bin\NameServer.xml.config".

  • 해당 NameServer와 관련된 지역(MasterServer) 목록을 위한 하나의 파일. 이 파일은 "deploy\NameServer\bin\NameServer.xml.config"에서 'NameServerConfig' 설정으로 변경 될 수 있습니다. 기본값은 "deploy\Nameserver.json"입니다.

'NameServer'는 이제 PhotonServer.config의 LoadBalancing 인스턴스의 기본 애플리케이션으로 v4의 'Master'를 대체합니다.

LoadBalancer 및 Workload 환경 구성 변경 사항

레벨 이름 변경

v4에서는 5 레벨만 존재했습니다. 이 레벨들의 이름은 'Lowest', 'Low', 'Middle', 'High' 그리고 'Highest'이었습니다.

이제 우리는 'Level0', 'Level1', 'Level2', ..., 'Level9' 와 같이 사용합니다. 'Lowest'는 'Level0'으로 변경되었습니다. 'Highest'는 'Level9'로 변경되었습니다.

Workload 환경 구성 변경

GameServer 설정 "WorkloadConfigFile"은 LoadBalancer 구성 파일의 경로를 설정합니다. v5에서는 기본적으로 "deploy\Workload.1Gbps.config"입니다 (이전에는 "Workload.config"). 다른 예제 파일인 "Workload.config"도 SDK에서 사용할 수 있습니다.

컨트롤러 설정 변경

이전 컨트롤러 설정:

XML

<add Name="{ControllerName}" InitialInput="0" InitialLevel="Lowest">
  <FeedbackLevels>
    <add Level="Lowest" Value="{LowestValue}"/>
    <add Level="Low" Value="{LowValue}"/>
    <add Level="Normal" Value="{NormalValue}"/>
    <add Level="High" Value="{HighValue}"/>
    <add Level="Highest" Value="{HighestValue}"/>
  </FeedbackLevels>
</add>

신규 컨트롤러 설정:

XML

<Controller Name="{ContollerName}" InitialInput="0" InitialLevel="Lowest">
  <FeedbackLevels>
    <Level name="0" Level="Level0" Value="{Value0}" ValueDown="{ValueDown0}"/>
    <Level name="1" Level="Level1" Value="{Value1}" ValueDown="{ValueDown1}"/>
    <Level name="2" Level="Level2" Value="{Value2}" ValueDown="{ValueDown2}"/>
    <Level name="3" Level="Level3" Value="{Value3}" ValueDown="{ValueDown3}"/>
    <Level name="4" Level="Level4" Value="{Value4}" ValueDown="{ValueDown4}"/>
    <Level name="5" Level="Level5" Value="{Value5}" ValueDown="{ValueDown5}"/>
    <Level name="6" Level="Level6" Value="{Value6}" ValueDown="{ValueDown6}"/>
    <Level name="7" Level="Level7" Value="{Value7}" ValueDown="{ValueDown7}"/>
    <Level name="8" Level="Level8" Value="{Value8}" ValueDown="{ValueDown8}"/>
    <Level name="9" Level="Level9" Value="{Value9}" ValueDown="{ValueDown9}"/>
  </FeedbackLevels>
</Controller>

파일 구조체 변경

이전 구조체:

XML

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

새로운 구조체 (래퍼 <Configuration></Configuration> 요소/노드 추가됨):

XML

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

LoadBalancer 환경 구성 변경 사항

LoadBalancer 환경 구성 파일은 "deploy\LoadBalancer.config"입니다.

XML

<?xml version="1.0" encoding="utf-8" ?>
<LoadBalancer>
  <LoadBalancerWeights>
    <add Level="Lowest" Value="{LowestValue}"/>
    <add Level="Low" Value="{LowValue}"/>
    <add Level="Normal" Value="{NormalValue}"/>
    <add Level="High" Value="{HighValue}"/>
    <add Level="Highest" Value="{HighestValue}"/>
  </LoadBalancerWeights>
</LoadBalancer>

새로운 구조체 (래퍼 <Configuration></Configuration> 요소/노드 추가됨):

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