瀏覽代碼

修复本地cache中登录过其它服务器后,下次登录可能选服报错的问题

大爷 1 年之前
父節點
當前提交
01deac2ee2

+ 1 - 2
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs

@@ -3,7 +3,6 @@ using FairyGUI;
 using Sirenix.Utilities;
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using UnityEngine;
 
 namespace ET.Client
@@ -50,7 +49,7 @@ namespace ET.Client
                     var ipendpoint = NetworkHelper.ToIPEndPoint(saveip);
 
                     servers.Add($"Custom[{saveip}]");
-                    ServerInfo.ServerList.Append(new ServerInfo()
+                    ServerInfo.ServerList.Add(new ServerInfo()
                     {
                         ShowName = $"Custom[{saveip}]",
                         Ip = ipendpoint.Address.ToString(),

+ 7 - 5
Unity/Assets/Scripts/Codes/Model/Client/Login/ServerInfo.cs

@@ -1,4 +1,6 @@
-namespace ET.Client
+using System.Collections.Generic;
+
+namespace ET.Client
 {
     public class ServerInfo
     {
@@ -8,17 +10,17 @@
 
         public string HostStr { get { return Ip + ":" + Port; } }
 
-        public static ServerInfo[] ServerList;
+        public static List<ServerInfo> ServerList;
         static ServerInfo()
         {
-            ServerList = new[]{
+            ServerList = new(){
                 new ServerInfo{
-                    ShowName = "本地[localhost:303000]",
+                    ShowName = "本地[localhost:30300]",
                     Ip = "127.0.0.1",
                     Port = 30300
                 },
                 new ServerInfo{
-                    ShowName = "外网[47.122.5.112:303000]",
+                    ShowName = "外网[47.122.5.112:30300]",
                     Ip = "47.122.5.112",
                     Port = 30300
                 },