PhotonServerSettings Error in Editor

Hey Guys,
I get the following Error when selecting the ServerSettings Asset in the Editor:

IndexOutOfRangeException: Index was outside the bounds of the array.
ServerSettingsInspector.OnInspectorGUI () (at Assets/Photon/PhotonUnityNetworking/Code/Editor/ServerSettingsInspector.cs:133)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a0a9ad37e16b4f7cb955e1101b72d4cc>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Working on Current PUN v2 with Unity 2019.4.1f1
Cheers.

Comments

  • Which PUN 2 version is it? The current is 2.21 and just a few days old. Just update the package in the Asset Store window and import again to get that.
    Let us know if the problem persists.
  • This happened to me as well. PUN 2.25.
    I already had a PUN configured in my home pc and uploaded it to git. The problem was surfaced when I had pulled the git on the computer with the old version of PUN. Even after removing the old and installing the new version of pun, I was getting this error. Also, my PUN Dashboard had an area configured already before the script could allow me to edit the area on the dashboard via EditWhiteList. See the attached picture for clarification.
    https://drive.google.com/file/d/15YCikV7Zo7udBrGkGbJQqcnbgWw8k4wK/view?usp=sharing

    Finally it was solved by doing the following thing.
    open ServerSettingsInspector
    if (!string.IsNullOrEmpty(PhotonNetwork.BestRegionSummaryInPreferences))
            {
                this.regionsPrefsList = PhotonNetwork.BestRegionSummaryInPreferences.Split(';');
                if (this.regionsPrefsList == null || this.regionsPrefsList.Length == 0 || string.IsNullOrEmpty(this.regionsPrefsList[0]))
                {
                    this.prefLabel = notAvailableLabel;
                }
                else
                {
                    this.prefLabel = string.Format("'{0}' ping:{1}ms ", this.regionsPrefsList[0], this.regionsPrefsList[1]);
                }
            }
            else
            {
                this.prefLabel = notAvailableLabel;
            }
    
    //Change this line from
    this.prefLabel = string.Format("'{0}' ping:{1}ms ", this.regionsPrefsList[0], this.regionsPrefsList[1]);
    //To this line
    this.prefLabel = string.Format("'{0}' ping:{1}ms ", this.regionsPrefsList[0], this.regionsPrefsList[0]);
    

    Once the script is successfully executed and you can see the complete GUI of PUN Wizard, change the above script to its original format.
  • PUN v2.26 should have a fix for this. Thanks for the report and workaround!
Sign In or Register to comment.