Modifying Photon.LoadBalancing.dll.config from inside Unity with a specific IP crashes the server

Options
I am trying to modify the Photon.LoadBalancing.dll.config file in the GameServer folder from inside Unity via this codeblock:
XmlDocument xml = new XmlDocument();
xml.Load(Application.dataPath + "/../PhotonServer/deploy/Loadbalancing/GameServer/bin/Photon.LoadBalancing.dll.config");
xml.SelectSingleNode("descendant::setting[value='127.0.0.1']").NextSibling.NextSibling.NextSibling.NextSibling.LastChild.InnerText = System.Net.IPAddress.Parse(IPField.text).ToString();
xml.Save(Application.dataPath + "/../PhotonServer/deploy/Loadbalancing/GameServer/bin/Photon.LoadBalancing.dll.config");

The modification of the XML file is done successfully and I have manually checked the config file to confirm that the correct IP address has been saved.

However when I try to start the photon server from the .cmd file provided, the photon server launches and then craches after a few tries.

This does not happen when I try to launch PhotonControl.exe and specifying the IP address from the Game Server Settings option.

I am not sure what I am doing wrong here.

this is the logs I am getting:
77944: 05:50:54.777 - Service is running...
77944: 05:51:01.662 - Game:3 - PhotonRunning() failed.
Exception:
System.FormatException: An invalid IP address was specified.
   at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
   at Photon.LoadBalancing.GameServer.GameApplication.Setup() in d:\dev\photon-socketserver-sdk_cloud\src-server\LoadBalancing\LoadBalancing\GameServer\GameApplication.cs:line 316
   at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning() in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 1189
   at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.PhotonRunning()
   at PhotonHostRuntime.PhotonDomainManager.PhotonRunning()
77944: 05:51:01.662 - CService::OnException() - Exception: CManagedHost::PhotonRunning() - Failed in AppDomain: 3 - An invalid IP address was specified.

Best Answer

  • FadiB
    FadiB
    Answer ✓
    Options
    I solved this issue by changing the code to use System.Xml.Linq instead. I am not sure why the above code didnt work. With doing it just from System.Xml instead.

    This is the lines I use now and it works.
    using System.Xml.Linq;
    
    public void Connect()
            {
                string path = Application.dataPath + "/../PhotonServer/deploy/Loadbalancing/GameServer/bin/Photon.LoadBalancing.dll.config";
                XDocument xml = XDocument.Load(path, LoadOptions.PreserveWhitespace);
                XElement gameServerSettings = null;
                foreach (var g in xml.Descendants("Photon.LoadBalancing.GameServer.GameServerSettings"))
                {
                    gameServerSettings = g;
                    break;
                }
    
                if (gameServerSettings != null)
                {
                    foreach (var s in gameServerSettings.Descendants("setting"))
                    {
                        string name = (string)s.Attribute("name");
                        if (name == "PublicIPAddress")
                        {
                            XElement valueElement = s.Element("value");
                            valueElement.SetValue(IPField.text.ToString());
                            break;
                        }
                    }
                    xml.Save(path, SaveOptions.DisableFormatting);
                }
            }
    

Answers

  • chvetsov
    Options
    Hi, @FadiB

    this means that you do something wrong. could you provide us what you get before server start?

    best,
    ilya
  • FadiB
    Options
    These are the full logs. I am almost certain that I am not doing it wrong because I have inspected the before and after version of the XML and they are identical. The newly added IP is also placed in the correct position. That is why I am not sure what is going wrong.
    77944: 05:50:50.726 - ---
    77944: 05:50:50.726 - Service: "Photon Socket Server" starting
    77944: 05:50:50.726 - Config File: D:\Unity\ProjectX\PhotonServer\deploy\bin_Win64\PhotonServer.config
    77944: 05:50:50.730 - Will produce at most: 10 crash dumps
    77944: 05:50:50.730 - Action: run as exe
    77944: 05:50:50.731 - Server Starting...
    77944: 05:50:50.731 -    Tick count: 50213531 (wraps in: 49.1291 days)
    77944: 05:50:50.731 - Tick count 64: 50213531
    77944: 05:50:50.731 - Photon Version: 4.0.28.2962
    77944: 05:50:50.731 - PID: 75520
    77944: 05:50:50.732 - Config File: D:\Unity\ProjectX\PhotonServer\deploy\bin_Win64\PhotonServer.config
    77944: 05:50:50.733 - Will NOT log unimportant exceptions
    77944: 05:50:50.735 - Not using performance counters as they are not currently installed. Run the service with /InstallCounters to install them.
    77944: 05:50:50.736 - Shutdown timeout enabled: 30000ms
    77944: 05:50:50.736 - Starting I/O thread pool with 2 threads
    77944: 05:50:50.736 - Using Standard allocator
    77944: 05:50:50.736 - Max message size: 512000
    77944: 05:50:50.736 - Starting business logic thread pool with the following settings
    77944: 05:50:50.736 - InitialThreads: 4 threads
    77944: 05:50:50.736 - MinThreads: 4 threads
    77944: 05:50:50.736 - Thread pool is fixed size
    77944: 05:50:50.737 - Starting ENet thread pool with the following settings
    77944: 05:50:50.737 - InitialThreads: 2 threads
    77944: 05:50:50.737 - MinThreads: 2 threads
    77944: 05:50:50.737 - Thread pool is fixed size
    77944: 05:50:50.737 - OnlyDispatchTimers: False
    77944: 05:50:50.737 - S2S: flow control: Max pending writes: 50
    77944: 05:50:50.737 - S2S: flow control: Max queued buffers: 200
    77944: 05:50:50.737 - S2S: flow control: Max pending writes MUX: 500
    77944: 05:50:50.737 - S2S: flow control: Max queued buffers MUX: 2000
    77944: 05:50:50.737 - S2S: MaxInboundMessageSize: 512000
    77944: 05:50:50.737 - S2S: MaxOutboundMessageSize: 512000
    77944: 05:50:50.737 - S2S: No inactivity timeout
    77944: 05:50:50.743 - WebSocket S2S: MaxInboundMessageSize: 512000
    77944: 05:50:50.743 - WebSocket S2S: MaxOutboundMessageSize: 512000
    77944: 05:50:50.743 - WebSocket S2S: No inactivity timeout
    77944: 05:50:50.743 - Max Reliable Data In Transit (awaiting ACKs) per peer : 51200 bytes
    77944: 05:50:50.743 - Per peer bandwidth limit
    77944: 05:50:50.743 - Transmit Rate Limit: 256 KB/Sec
    77944: 05:50:50.743 - Limit period: 200ms
    77944: 05:50:50.743 - Limit per period: 52428 bytes
    77944: 05:50:50.743 - Max queued data for transmission per peer: 512000 bytes
    77944: 05:50:50.743 - Minimum retransmit timeout: 200
    77944: 05:50:50.743 - No Maximum retransmit timeout
    77944: 05:50:50.743 - Minimum ENet timeout: 5000ms
    77944: 05:50:50.743 - Maximum ENet timeout: 30000ms
    77944: 05:50:50.743 - Max Inbound Reliable Data Queued (awaiting resends of earlier sequence numbers) per peer : 163840 bytes
    77944: 05:50:50.743 - No RTT ACK adjustment timeout
    77944: 05:50:50.743 - Outbound ENet: MaxInboundMessageSize: 512000
    77944: 05:50:50.743 - Outbound ENet: MaxOutboundMessageSize: 512000
    77944: 05:50:50.746 - GetRuntime - About to load CLR - versions available:
    77944: 05:50:50.746 - v2.0.50727
    77944: 05:50:50.746 - v4.0.30319
    77944: 05:50:50.746 - Configuration requests: "v2.0.50727"
    77944: 05:50:50.746 - About to load version: "v2.0.50727"
    77944: 05:50:50.756 - About to load runtime: PhotonHostRuntime.PhotonDomainManager from PhotonHostRuntime, Culture=neutral, PublicKeyToken=02C301B61B060C4D
    77944: 05:50:50.756 - CLRBaseDirectory set to "D:\Unity\ProjectX\PhotonServer\deploy"
    77944: 05:50:50.756 - Optimising event broadcast for 20 or more peers
    77944: 05:50:50.757 - Start: About to load CLR - versions available:
    77944: 05:50:50.757 - v2.0.50727
    77944: 05:50:50.757 - v4.0.30319
    77944: 05:50:50.757 - No preference in configuration file, will load latest.
    77944: 05:50:50.757 - About to load version: "v4.0.30319"
    77944: 05:50:50.760 - Loaded version: "v4.0.30319"
    77944: 05:50:51.242 - Photon host runtime loaded
    77944: 05:50:53.875 - LICENSE: No license file was found. Starting with Bootstrap License.
    77944: 05:50:53.875 - License is valid.
    77944: 05:50:53.875 - Licensed for 20 concurrent connections.
    77944: 05:50:53.875 - ENet: Max Reliable Data In Transit (awaiting ACKs) per peer : 51200 bytes
    77944: 05:50:53.875 - ENet: Per peer bandwidth limit
    77944: 05:50:53.875 - ENet: Transmit Rate Limit: 256 KB/Sec
    77944: 05:50:53.875 - ENet: Limit period: 200ms
    77944: 05:50:53.875 - ENet: Limit per period: 52428 bytes
    77944: 05:50:53.875 - ENet: Max queued data for transmission per peer: 512000 bytes
    77944: 05:50:53.875 - ENet: Minimum retransmit timeout: 200
    77944: 05:50:53.875 - No Maximum retransmit timeout
    77944: 05:50:53.875 - ENet: Minimum timeout: 5000ms
    77944: 05:50:53.875 - ENet: Maximum timeout: 30000ms
    77944: 05:50:53.875 - ENet: Max Inbound Reliable Data Queued (awaiting resends of earlier sequence numbers) per peer : 163840 bytes
    77944: 05:50:53.875 - No RTT ACK adjustment timeout
    77944: 05:50:53.875 - About to load application: Master from Photon.LoadBalancing
    77944: 05:50:53.875 - Auto restart is enabled for application, existing connections will be terminated during restart
    77944: 05:50:53.875 - Application will restart 1000ms after the last change detected
    77944: 05:50:53.875 - Application will restart if files matching the following are changed: "dll;config"
    77944: 05:50:53.875 - Application will NOT restart if files matching the following are changed: "log4net.config"
    77944: 05:50:54.043 - Taking reference on default app domain
    77944: 05:50:54.158 - Application: "Master" started in app domain: 2
    77944: 05:50:54.158 - About to load application: Game from Photon.LoadBalancing
    77944: 05:50:54.158 - Auto restart is enabled for application, existing connections will be terminated during restart
    77944: 05:50:54.158 - Application will restart 1000ms after the last change detected
    77944: 05:50:54.158 - Application will restart if files matching the following are changed: "dll;config"
    77944: 05:50:54.158 - Application will NOT restart if files matching the following are changed: "log4net.config"
    77944: 05:50:54.319 - Taking reference on default app domain
    77944: 05:50:54.492 - Application: "Game" started in app domain: 3
    77944: 05:50:54.492 - About to load application: CounterPublisher from CounterPublisher
    77944: 05:50:54.492 - Auto restart is enabled for application, existing connections will be terminated during restart
    77944: 05:50:54.492 - Application will restart 1000ms after the last change detected
    77944: 05:50:54.492 - Application will restart if files matching the following are changed: "dll;config"
    77944: 05:50:54.492 - Application will NOT restart if files matching the following are changed: "log4net.config"
    77944: 05:50:54.610 - Taking reference on default app domain
    77944: 05:50:54.680 - Application: "CounterPublisher" started in app domain: 4
    77944: 05:50:54.680 - Adding TCP listener on: 0.0.0.0: 4530 with a listen backlog of: 150
    77944: 05:50:54.680 - TCP inactivity timeout: 10000ms
    77944: 05:50:54.680 - TCP disconnect timeout: 120000ms
    77944: 05:50:54.680 - MaxInboundMessageSize: 512000
    77944: 05:50:54.680 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.680 - Forcing all applications ids to: "Master"
    77944: 05:50:54.681 - Serving policy file requests from: "D:\Unity\ProjectX\PhotonServer\deploy\Policy\assets\socket-policy.xml"
    77944: 05:50:54.681 - Adding TCP listener on: 0.0.0.0: 4531 with a listen backlog of: 150
    77944: 05:50:54.681 - TCP inactivity timeout: 10000ms
    77944: 05:50:54.681 - TCP disconnect timeout: 120000ms
    77944: 05:50:54.681 - MaxInboundMessageSize: 512000
    77944: 05:50:54.681 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.681 - Forcing all applications ids to: "Game"
    77944: 05:50:54.681 - Serving policy file requests from: "D:\Unity\ProjectX\PhotonServer\deploy\Policy\assets\socket-policy.xml"
    77944: 05:50:54.681 - Adding TCP listener on: 0.0.0.0: 4520 with a listen backlog of: 150
    77944: 05:50:54.681 - TCP inactivity timeout: 5000ms
    77944: 05:50:54.681 - TCP disconnect timeout: 120000ms
    77944: 05:50:54.681 - MaxInboundMessageSize: 512000
    77944: 05:50:54.681 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.681 - Forcing all applications ids to: "Master"
    77944: 05:50:54.681 - MaxInboundMessageSize: 512000
    77944: 05:50:54.681 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.681 - UDP address specified as: "0.0.0.0" adding listener to each available IPv4 address
    77944: 05:50:54.682 - Adding UDP listener on: 192.168.10.214: 5055 with a listen backlog of: 500
    77944: 05:50:54.682 - Adding UDP listener on: 25.1.140.215: 5055 with a listen backlog of: 500
    77944: 05:50:54.682 - Adding UDP listener on: 127.0.0.1: 5055 with a listen backlog of: 500
    77944: 05:50:54.682 - Forcing all applications ids to: "Game"
    77944: 05:50:54.682 - MaxInboundMessageSize: 512000
    77944: 05:50:54.682 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.682 - UDP address specified as: "0.0.0.0" adding listener to each available IPv4 address
    77944: 05:50:54.684 - Adding UDP listener on: 192.168.10.214: 5056 with a listen backlog of: 500
    77944: 05:50:54.684 - Adding UDP listener on: 25.1.140.215: 5056 with a listen backlog of: 500
    77944: 05:50:54.684 - Adding UDP listener on: 127.0.0.1: 5056 with a listen backlog of: 500
    77944: 05:50:54.684 - Adding WebSocket TCP listener on: 0.0.0.0: 9090 with a listen backlog of: 150
    77944: 05:50:54.684 - Nagle disabled
    77944: 05:50:54.684 - TCP inactivity timeout: 10000ms
    77944: 05:50:54.684 - MaxInboundMessageSize: 512000
    77944: 05:50:54.684 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.684 - Forcing all applications ids to: "Master"
    77944: 05:50:54.684 - Will accept ANY sub-protocols from the client
    77944: 05:50:54.684 - No automatic WebSocket ping
    77944: 05:50:54.684 - Adding WebSocket TCP listener on: 0.0.0.0: 9091 with a listen backlog of: 150
    77944: 05:50:54.684 - Nagle disabled
    77944: 05:50:54.684 - TCP inactivity timeout: 10000ms
    77944: 05:50:54.684 - MaxInboundMessageSize: 512000
    77944: 05:50:54.684 - MaxOutboundMessageSize: 512000
    77944: 05:50:54.684 - Forcing all applications ids to: "Game"
    77944: 05:50:54.684 - Will accept ANY sub-protocols from the client
    77944: 05:50:54.684 - No automatic WebSocket ping
    77944: 05:50:54.685 - Adding Policy File listener on: 0.0.0.0: 843 with a listen backlog of: 150 and serving Policy File: "D:\Unity\ProjectX\PhotonServer\deploy\Policy\assets\socket-policy.xml"
    77944: 05:50:54.685 - TCP inactivity timeout: 1000ms
    77944: 05:50:54.685 - Adding Policy File listener on: 0.0.0.0: 943 with a listen backlog of: 150 and serving Policy File: "D:\Unity\ProjectX\PhotonServer\deploy\Policy\assets\socket-policy-silverlight.xml"
    77944: 05:50:54.685 - TCP inactivity timeout: 1000ms
    77944: 05:50:54.777 - Service is running...
    77944: 05:51:01.662 - Game:3 - PhotonRunning() failed.
    Exception:
    System.FormatException: An invalid IP address was specified.
       at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
       at Photon.LoadBalancing.GameServer.GameApplication.Setup() in d:\dev\photon-socketserver-sdk_cloud\src-server\LoadBalancing\LoadBalancing\GameServer\GameApplication.cs:line 316
       at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning() in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 1189
       at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.PhotonRunning()
       at PhotonHostRuntime.PhotonDomainManager.PhotonRunning()
    77944: 05:51:01.662 - CService::OnException() - Exception: CManagedHost::PhotonRunning() - Failed in AppDomain: 3 - An invalid IP address was specified.
    77944: 05:51:01.662 - Server shutting down...
    77944: 05:51:01.662 - Shutdown monitoring enabled, 30000ms before process abort
    77944: 05:51:01.662 - Notifying CLR applications of shutdown...
    77944: 05:51:01.662 - RequestApplicationStop: 4
    77944: 05:51:01.674 - RequestApplicationStop: 3
    77944: 05:51:01.697 - RequestApplicationStop: 2
    77944: 05:51:01.735 - RequestStop: defalt app domain
    77944: 05:51:01.740 - Shutting down WebSocket Outbound Connection Manager...
    77944: 05:51:01.740 - Shutting down TCP Outbound Connection Manager...
    77944: 05:51:01.740 - Shutting down ENet Outbound Connection Manager...
    77944: 05:51:01.740 - Disconnecting all outbound peers...
    77944: 05:51:01.740 - Shutting down ENet host...
    77944: 05:51:01.740 - Disconnecting all peers...
    77944: 05:51:01.740 - 1 disconnected
    77944: 05:51:01.740 - Shutting down socket servers...
    77944: 05:51:01.794 - Shutting down ENet thread pool...
    77944: 05:51:01.794 - Shutting down TCP inactivity timers...
    77944: 05:51:01.795 - ENet Host - Resetting all peers...
    77944: 05:51:01.795 - WaitingForShutdownToComplete: NativePolicy:0.0.0.0:843
    77944: 05:51:01.795 - OnShutdownCompleted: NativePolicy:0.0.0.0:843
    77944: 05:51:01.795 - WaitingForShutdownToComplete: NativePolicy:0.0.0.0:943
    77944: 05:51:01.795 - OnShutdownCompleted: NativePolicy:0.0.0.0:943
    77944: 05:51:01.795 - WaitingForShutdownToComplete: TCP:0.0.0.0:4520
    77944: 05:51:01.795 - OnShutdownCompleted: TCP:0.0.0.0:4520
    77944: 05:51:01.795 - WaitingForShutdownToComplete: TCP:0.0.0.0:4530
    77944: 05:51:01.795 - OnShutdownCompleted: TCP:0.0.0.0:4530
    77944: 05:51:01.795 - WaitingForShutdownToComplete: TCP:0.0.0.0:4531
    77944: 05:51:01.795 - OnShutdownCompleted: TCP:0.0.0.0:4531
    77944: 05:51:01.795 - WaitingForShutdownToComplete: UDP:127.0.0.1:5055
    77944: 05:51:01.795 - OnShutdownCompleted: UDP:127.0.0.1:5055
    77944: 05:51:01.795 - WaitingForShutdownToComplete: UDP:127.0.0.1:5056
    77944: 05:51:01.795 - OnShutdownCompleted: UDP:127.0.0.1:5056
    77944: 05:51:01.795 - WaitingForShutdownToComplete: UDP:192.168.10.214:5055
    77944: 05:51:01.795 - OnShutdownCompleted: UDP:192.168.10.214:5055
    77944: 05:51:01.795 - WaitingForShutdownToComplete: UDP:192.168.10.214:5056
    77944: 05:51:01.795 - OnShutdownCompleted: UDP:192.168.10.214:5056
    77944: 05:51:01.795 - WaitingForShutdownToComplete: UDP:25.1.140.215:5055
    77944: 05:51:01.795 - OnShutdownCompleted: UDP:25.1.140.215:5055
    77944: 05:51:01.795 - WaitingForShutdownToComplete: UDP:25.1.140.215:5056
    77944: 05:51:01.795 - OnShutdownCompleted: UDP:25.1.140.215:5056
    77944: 05:51:01.795 - WaitingForShutdownToComplete: WebSocket:0.0.0.0:9090
    77944: 05:51:01.795 - OnShutdownCompleted: WebSocket:0.0.0.0:9090
    77944: 05:51:01.795 - WaitingForShutdownToComplete: WebSocket:0.0.0.0:9091
    77944: 05:51:01.795 - OnShutdownCompleted: WebSocket:0.0.0.0:9091
    77944: 05:51:01.795 - Shutting down CLR applications...
    75380: 05:51:01.807 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain
    77944: 05:51:01.832 - Shutting down business logic thread pool...
    77944: 05:51:01.835 - Shutting down I/O thread pool...
    77944: 05:51:01.835 - Destroying servers
    82052: 05:51:01.835 - Unloading Domain: ApplicationName = 'CounterPublisher', DomainId='4'
    77944: 05:51:01.836 - Destroying WebSocket Outbound Connection Manager
    77944: 05:51:01.836 - Destroying TCP Outbound Connection Manager
    77944: 05:51:01.836 - Destroying TCP inactivity timer
    77944: 05:51:01.836 - Destroying ENet timer wheel
    77944: 05:51:01.836 - Destroying ENet host
    75380: 05:51:01.836 - CManagedHost::OnDomainUnload() - 4
    77944: 05:51:01.836 - Destroying ENet outbound host
    77944: 05:51:01.836 - Destroying HTTP inactivity timer
    77944: 05:51:01.836 - Destroying HTTP host
    77944: 05:51:01.836 - Destroying HTTP Chunk host
    77944: 05:51:01.836 - Flushing ENET buffer allocator...
    77944: 05:51:01.841 - Flushing TCP buffer handle allocator...
    77944: 05:51:01.841 - Flushing stream socket allocator...
    77944: 05:51:01.841 - Flushing inbound datagram socket allocator...
    77944: 05:51:01.851 - Flushing outbound datagram socket allocator...
    77944: 05:51:01.851 - Destroying CLR dispatcher
    77944: 05:51:01.851 - Destroying CLR applications
    77944: 05:51:01.852 - ~CCLRApplicationCollection() - Waiting up to 10 seconds for the CLR to release all of our objects
    75380: 05:51:01.932 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain
    82052: 05:51:01.949 - Unloading Domain: ApplicationName = 'Master', DomainId='2'
    75380: 05:51:01.951 - CManagedHost::OnDomainUnload() - 2
    75380: 05:51:01.960 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain
    82052: 05:51:01.988 - Unloading Domain: ApplicationName = 'Game', DomainId='3'
    75380: 05:51:01.989 - CManagedHost::OnDomainUnload() - 3
    77944: 05:51:01.996 - ~CCLRApplicationCollection() - Done. All objects released
    77944: 05:51:01.996 - ~CManagedHost() - Release default app domain
    77944: 05:51:01.996 - CManagedHost::OnDomainUnload() - 1
    77944: 05:51:01.997 - ~CManagedHost() - Waiting up to 10 seconds for CLR shutdown...
    77944: 05:51:01.997 - ~CManagedHost
    77944: 05:51:01.997 - Destroying ENet thread pool
    77944: 05:51:01.997 - Destroying Business logic thread pool
    77944: 05:51:01.997 - Destroying I/O thread pool
    77944: 05:51:01.997 - Destroying ENet buffer allocator
    77944: 05:51:01.997 - Destroying TCP buffer allocator
    77944: 05:51:01.997 - Destroying TCP socket allocator
    77944: 05:51:01.997 - Destroying ENet inbound socket allocator
    77944: 05:51:01.997 - Destroying ENet outbound socket allocator
    77944: 05:51:01.997 - Destroying shared datagram flow control data
    77944: 05:51:01.997 - Shutdown complete...
    77944: 05:51:01.997 - Service shutting down
    77944: 05:51:02.007 - Service shut down complete
    
    
  • chvetsov
    Options
    log does not help
    I need final config

    best,
    ilya
  • FadiB
    FadiB
    Answer ✓
    Options
    I solved this issue by changing the code to use System.Xml.Linq instead. I am not sure why the above code didnt work. With doing it just from System.Xml instead.

    This is the lines I use now and it works.
    using System.Xml.Linq;
    
    public void Connect()
            {
                string path = Application.dataPath + "/../PhotonServer/deploy/Loadbalancing/GameServer/bin/Photon.LoadBalancing.dll.config";
                XDocument xml = XDocument.Load(path, LoadOptions.PreserveWhitespace);
                XElement gameServerSettings = null;
                foreach (var g in xml.Descendants("Photon.LoadBalancing.GameServer.GameServerSettings"))
                {
                    gameServerSettings = g;
                    break;
                }
    
                if (gameServerSettings != null)
                {
                    foreach (var s in gameServerSettings.Descendants("setting"))
                    {
                        string name = (string)s.Attribute("name");
                        if (name == "PublicIPAddress")
                        {
                            XElement valueElement = s.Element("value");
                            valueElement.SetValue(IPField.text.ToString());
                            break;
                        }
                    }
                    xml.Save(path, SaveOptions.DisableFormatting);
                }
            }
    
  • chvetsov
    Options
    good that you managed to solve it

    best,
    ilya