http://127.0.0.1:10300/get_router?v=261624887 这个连接可以在浏览器里请求 返回{ “_t” : “HttpGetRouterResponse”, “Realms” : [“127.0.0.1:10002”], “Routers” : [“127.0.0.1:10301”, “127.0.0.1:10302”, “127.0.0.1:10303”, “127.0.0.1:10304”] }说明服务器是启动成功的,我unity开启ENABLE_CODES宏之后,应该是不需要再编译代码了,直接运行就可以了。但是两种方式都出现了这个报错。
System.Exception: http request fail: http://127.0.0.1:10300/get_router
System.ArgumentException: Illegal byte sequence encounted in the input.
Parameter name: string
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_string_from_byvalstr(intptr,int)
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStructure(intptr,System.Type)
at System.Runtime.InteropServices.Marshal.PtrToStructure[T] (System.IntPtr ptr) [0×00000] in <c2a97e0383e8404c9fc0ae19d58f57f1>:0
at System.Net.NetworkInformation.Win32NetworkInterface.get_FixedInfo () [0×00024] in <a6f433c7914f4a8aa11562de443cf6c1>:0
at System.Net.NetworkInformation.Win32IPGlobalProperties.get_DomainName () [0×00000] in <a6f433c7914f4a8aa11562de443cf6c1>:0
at System.Net.CookieContainer..ctor () [0×0003f] in <a6f433c7914f4a8aa11562de443cf6c1>:0
at System.Net.Http.MonoWebRequestHandler.get_CookieContainer () [0×0000a] in <b4f2827d4068467e8a281f96bb3f5e3c>:0
at System.Net.Http.MonoWebRequestHandler.CreateWebRequest (System.Net.Http.HttpRequestMessage request) [0×000f5] in <b4f2827d4068467e8a281f96bb3f5e3c>:0
at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0×000cf] in <b4f2827d4068467e8a281f96bb3f5e3c>:0
at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0×000e8] in <b4f2827d4068467e8a281f96bb3f5e3c>:0
at ET.Client.HttpClientHelper.Get (System.String link) [0×0005b] in C:\GitProject\ET\Unity\Assets\Scripts\Codes\Hotfix\Client\Demo\Router\HttpClientHelper.cs:15
at ET.Client.HttpClientHelper.Get (System.String link) [0×00179] in C:\GitProject\ET\Unity\Assets\Scripts\Codes\Hotfix\Client\Demo\Router\HttpClientHelper.cs:21
at ET.ETTask`1[T].GetResult () [0×00043] in C:\GitProject\ET\Unity\Assets\Scripts\ThirdParty\ETTask\ETTask.cs:246
at ET.Client.RouterAddressComponentSystem.GetAllRouter (ET.Client.RouterAddressComponent self) [0×00073] in C:\GitProject\ET\Unity\Assets\Scripts\Codes\Hotfix\Client\Demo\Router\RouterAddressComponentSystem.cs:31
at ET.ETTask.GetResult () [0×00039] in C:\GitProject\ET\Unity\Assets\Scripts\ThirdParty\ETTask\ETTask.cs:126
at ET.Client.RouterAddressComponentSystem.Init (ET.Client.RouterAddressComponent self) [0×0003c] in C:\GitProject\ET\Unity\Assets\Scripts\Codes\Hotfix\Client\Demo\Router\RouterAddressComponentSystem.cs:24
at ET.ETTask.GetResult () [0×00039] in C:\GitProject\ET\Unity\Assets\Scripts\ThirdParty\ETTask\ETTask.cs:126
at ET.Client.LoginHelper.Login (ET.Scene clientScene, System.String account, System.String password) [0×000ab] in C:\GitProject\ET\Unity\Assets\Scripts\Codes\Hotfix\Client\Demo\Login\LoginHelper.cs:20
UnityEngine.Debug:LogError (object)
ET.UnityLogger:Error (string) (at Assets/Scripts/Mono/UnityLogger.cs:30)
ET.Logger:Error (System.Exception) (at Assets/Scripts/Core/Log/Logger.cs:94)
ET.Log:Error (System.Exception) (at Assets/Scripts/Core/Log/Log.cs:39)
ET.Client.LoginHelper/<Login>d__0:MoveNext () (at Assets/Scripts/Codes/Hotfix/Client/Demo/Login/LoginHelper.cs:45)
ET.ETAsyncTaskMethodBuilder:Start<ET.Client.LoginHelper/<Login>d0> (ET.Client.LoginHelper/<Login>d0&) (at Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs:57)
ET.Client.LoginHelper:Login (ET.Scene,string,string)
ET.Client.UILoginComponentSystem:OnLogin (ET.Client.UILoginComponent) (at Assets/Scripts/Codes/HotfixView/Client/Demo/UI/UILogin/UILoginComponentSystem.cs:26)
ET.Client.UILoginComponentSystem/UILoginComponentAwakeSystem/<>cDisplayClass0_0:<Awake>b0 () (at Assets/Scripts/Codes/HotfixView/Client/Demo/UI/UILogin/UILoginComponentSystem.cs:17)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)