- ET版本:7.2
- Unity版本:2021.3.18f1
- Net版本:7.0
修改服务监听地址为本机ip后,打包程序可以在本机正常运行,在虚拟机中报错,虚拟机浏览器可以正常访问本机服务端端口。请大佬指点一下这里链接不上是什么原因😭
本机正常运行截图:

虚拟机报错截图:

报错内容:
Found 1 interfaces on host : 0) 192.168.247.128Multi-casting “[IP] 192.168.247.128 [Port] 55000 [Flags] 19 [Guid] 4131059440 [EditorId] 2065119896 [Version] 1048832 [Id] WindowsPlayer(2,DESKTOP-49JL4L7) [Debug] 0 [PackageName] WindowsPlayer [ProjectName] ET” to [225.0.0.222:54997]…Initialize engine version: 2021.3.18f1 (3129e69bc0c7)[Subsystems] Discovering subsystems at path D:/ET框架Build包/Release/ET_Data/UnitySubsystemsGfxDevice: creating device client; threaded=1; jobified=0Direct3D: Version: Direct3D 11.0 [level 11.0] Renderer: VMware SVGA 3D (ID=0×405) Vendor: VMWare VRAM: 128 MB Driver: 9.17.4.1<RI> Initializing input.
XInput1_3.dll not found. Trying XInput9_1_0.dll instead…<RI> Input initialized.
<RI> Initialized touch support.
UnloadTime: 0.987800 msscene create: Process Process 0 946416728236359681 0System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Info(String)ET.Scene:.ctor(Int64, Int64, Int32, SceneType, String)ET.Root:Awake()ET.Game:AddSingleton(ISingleton)ET.Game:AddSingleton()System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)System.Reflection.MethodBase:Invoke(Object, Object[])
Setting up 2 worker threads for Enlighten.Async load bundle BundleName : D:/ET框架Build包/Release/ET_Data/StreamingAssets\unit.unity3dET.Client.<>cDisplayClass13_0:<LoadBundleAsync>gLoadDependency|0(String, List`1)ET.Client.<LoadBundleAsync>d13:MoveNext()ET.Client.ResourcesComponentSystem:LoadBundleAsync(ResourcesComponent, String)ET.Client.<Run>d0:MoveNext()ET.Client.EntryEvent3_InitClient:Run(Scene, EntryEvent3)ET.<Handle>d3:MoveNext()ET.AEvent`2:Handle(Scene, EntryEvent3)ET.<PublishAsync>d25`2:MoveNext()ET.EventSystem:PublishAsync(Scene, EntryEvent3)ET.<StartAsync>d2:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)ET.<LoadAsync>d6:MoveNext()ET.ThreadSynchronizationContext:Update()ET.Game:Update()
scene create: Client Game 1 946416728236359694 1ET.Client.<LoadBundleAsync>d13:MoveNext()ET.Client.<LoadOneBundleAllAssets>d15:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Info(String)ET.Scene:.ctor(Int64, Int64, Int32, SceneType, String)ET.EntitySceneFactory:CreateScene(Int32, SceneType, String, Entity)ET.<WaitAll>d5:MoveNext()ET.<WaitAsync>d4:MoveNext()ProtoBuf.Serializers.UriDecorator:get_ExpectedType()ET.<RunSubCoroutineAsync>d3:MoveNext()ET.<GetAwaiter>d0:MoveNext()UnityEngine.AsyncOperation:InvokeCompletionEvent()
Async load bundle BundleName : D:/ET框架Build包/Release/ET_Data/StreamingAssets\uilogin.unity3dET.Client.<>cDisplayClass13_0:<LoadBundleAsync>gLoadDependency|0(String, List`1)ET.Client.<LoadBundleAsync>d13:MoveNext()ET.Client.ResourcesComponentSystem:LoadBundleAsync(ResourcesComponent, String)ET.Client.<LoadAsync>d1:MoveNext()ET.Client.ResourcesLoaderComponentSystem:LoadAsync(ResourcesLoaderComponent, String)ET.Client.<OnCreate>d0:MoveNext()ET.Client.UILoginEvent:OnCreate(UIComponent, UILayer)ET.Client.<OnCreate>d1:MoveNext()ET.Client.UIEventComponentSystem:OnCreate(UIEventComponent, UIComponent, String, UILayer)ET.Client.<Create>d0:MoveNext()ET.Client.UIComponentSystem:Create(UIComponent, String, UILayer)ET.Client.<Create>d0:MoveNext()ET.Client.UIHelper:Create(Scene, String, UILayer)ET.Client.<Run>d0:MoveNext()ET.Client.AppStartInitFinish_CreateLoginUI:Run(Scene, AppStartInitFinish)ET.<Handle>d3:MoveNext()ET.AEvent`2:Handle(Scene, AppStartInitFinish)ET.<PublishAsync>d25`2:MoveNext()ET.EventSystem:PublishAsync(Scene, AppStartInitFinish)ET.Client.<Run>d0:MoveNext()ET.Client.<LoadBundleAsync>d13:MoveNext()ET.Client.<LoadOneBundleAllAssets>d15:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)ET.<WaitAll>d5:MoveNext()ET.<WaitAsync>d4:MoveNext()ProtoBuf.Serializers.UriDecorator:get_ExpectedType()ET.<RunSubCoroutineAsync>d3:MoveNext()ET.<GetAwaiter>d0:MoveNext()UnityEngine.AsyncOperation:InvokeCompletionEvent()
start get router info: http://192.168.1.44:30300/get_router?v=762036012ET.Client.RouterAddressComponentSystem:Init(RouterAddressComponent)ET.Client.<Login>d__0:MoveNext()ET.Client.LoginHelper:Login(Scene, String, String)ET.Client.UILoginComponentSystem:OnLogin(UILoginComponent)ET.Client.<>c__DisplayClass0_0:<Awake>b0()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)UnityEngine.Events.InvokableCall:Invoke(Object[])UnityEngine.Events.UnityEvent:Invoke()UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)UnityEngine.EventSystems.StandaloneInputModule:ReleaseMouse(PointerEventData, GameObject)UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData)UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32)UnityEngine.EventSystems.StandaloneInputModule:Process()UnityEngine.EventSystems.EventSystem:Update()
recv router info: { “t” : “HttpGetRouterResponse”, “Realms” : [“192.168.1.44:30002”], “Routers” : [“127.0.0.1:30301”, “127.0.0.1:30302”, “127.0.0.1:30303”, “127.0.0.1:30304”] }System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)ET.ThreadSynchronizationContext:Update()ET.Game:Update()
start get router info finish: { “t” : “HttpGetRouterResponse”, “Realms” : [“192.168.1.44:30002”], “Routers” : [“127.0.0.1:30301”, “127.0.0.1:30302”, “127.0.0.1:30303”, “127.0.0.1:30304”] }System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)ET.ThreadSynchronizationContext:Update()ET.Game:Update()
start get router address: 1 192.168.1.44:30002 0 0ET.Client.<CreateRouterSession>d0:MoveNext()ET.Client.RouterHelper:CreateRouterSession(Scene, IPEndPoint)ET.Client.<Login>d0:MoveNext()ET.Client.<Init>d1:MoveNext()ET.Client.<GetAllRouter>d2:MoveNext()ET.Client.<Get>d0:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Info(String)ET.ThreadSynchronizationContext:Update()ET.Game:Update()
router connect: 1308960611 0 0 127.0.0.1:30303 192.168.1.44:30002ET.Client.<GetRouterAddress>d1:MoveNext()ET.ETAsyncTaskMethodBuilder`1:Start(<GetRouterAddress>d1&)ET.Client.RouterHelper:GetRouterAddress(Scene, IPEndPoint, UInt32, UInt32)ET.Client.<CreateRouterSession>d0:MoveNext()ET.Client.RouterHelper:CreateRouterSession(Scene, IPEndPoint)ET.Client.<Login>d0:MoveNext()ET.Client.<Init>d1:MoveNext()ET.Client.<GetAllRouter>d2:MoveNext()ET.Client.<Get>d0:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Info(String)ET.ThreadSynchronizationContext:Update()ET.Game:Update()
System.Net.Sockets.SocketException (0×80004005): Connection reset by peer at ET.Client.RouterHelper.Connect (System.Net.IPEndPoint routerAddress, System.Net.IPEndPoint realAddress, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint& remoteEP) [0×00000] in <00000000000000000000000000000000>:0 at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Net.EndPoint& remoteEP) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitFrameAsync (ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitAsync (System.Int64 time, ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.Update () [0×00000] in <00000000000000000000000000000000>:0 at ET.Game.Update () [0×00000] in <00000000000000000000000000000000>:0 — End of stack trace from previous location where exception was thrown —
at ET.ETTask`1[T].GetResult () [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.GetRouterAddress (ET.Scene clientScene, System.Net.IPEndPoint address, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETTask`1[T].SetException (System.Exception e) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETAsyncTaskMethodBuilder`1[T].SetException (System.Exception exception) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.Connect (System.Net.IPEndPoint routerAddress, System.Net.IPEndPoint realAddress, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitFrameAsync (ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitAsync (System.Int64 time, ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.Update () [0×00000] in <00000000000000000000000000000000>:0 at ET.Game.Update () [0×00000] in <00000000000000000000000000000000>:0 — End of stack trace from previous location where exception was thrown —
at ET.ETTask`1[T].GetResult () [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.CreateRouterSession (ET.Scene clientScene, System.Net.IPEndPoint address) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETTask`1[T].SetException (System.Exception e) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETAsyncTaskMethodBuilder`1[T].SetException (System.Exception exception) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.GetRouterAddress (ET.Scene clientScene, System.Net.IPEndPoint address, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETTask`1[T].SetException (System.Exception e) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETAsyncTaskMethodBuilder`1[T].SetException (System.Exception exception) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.Connect (System.Net.IPEndPoint routerAddress, System.Net.IPEndPoint realAddress, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitFrameAsync (ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitAsync (System.Int64 time, ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.Update () [0×00000] in <00000000000000000000000000000000>:0 at ET.Game.Update () [0×00000] in <00000000000000000000000000000000>:0 — End of stack trace from previous location where exception was thrown —
at ET.Client.LoginHelper.Login (ET.Scene clientScene, System.String account, System.String password) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.CreateRouterSession (ET.Scene clientScene, System.Net.IPEndPoint address) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETTask`1[T].SetException (System.Exception e) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETAsyncTaskMethodBuilder`1[T].SetException (System.Exception exception) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.GetRouterAddress (ET.Scene clientScene, System.Net.IPEndPoint address, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETTask`1[T].SetException (System.Exception e) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETAsyncTaskMethodBuilder`1[T].SetException (System.Exception exception) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterHelper.Connect (System.Net.IPEndPoint routerAddress, System.Net.IPEndPoint realAddress, System.UInt32 localConn, System.UInt32 remoteConn) [0×00000] in <00000000000000000000000000000000>:0 at ET.ETTask`1[T].GetResult () [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitFrameAsync (ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.WaitAsync (System.Int64 time, ET.ETCancellationToken cancellationToken) [0×00000] in <00000000000000000000000000000000>:0 at ET.TimerComponent.Update () [0×00000] in <00000000000000000000000000000000>:0 at ET.Game.Update () [0×00000] in <00000000000000000000000000000000>:0 ET.ETAsyncTaskMethodBuilder`1:SetException(Exception)ET.Client.<GetRouterAddress>d1:MoveNext()ET.ETTask`1:SetException(Exception)ET.ETAsyncTaskMethodBuilder`1:SetException(Exception)ET.Client.<Connect>d2:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:LogError(Object)ET.Logger:Error(Exception)ET.<WaitFrameAsync>d14:MoveNext()ET.<WaitAsync>d15:MoveNext()ET.TimerComponent:Update()ET.Game:Update()
start get router info: http://192.168.1.44:30300/get_router?v=1209448626ET.Client.RouterAddressComponentSystem:Init(RouterAddressComponent)ET.Client.<Login>d__0:MoveNext()ET.Client.LoginHelper:Login(Scene, String, String)ET.Client.UILoginComponentSystem:OnLogin(UILoginComponent)ET.Client.<>cDisplayClass0_0:<Awake>b0()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)UnityEngine.Events.InvokableCall:Invoke(Object[])UnityEngine.Events.UnityEvent:Invoke()UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)UnityEngine.EventSystems.StandaloneInputModule:ReleaseMouse(PointerEventData, GameObject)UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData)UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32)UnityEngine.EventSystems.StandaloneInputModule:Process()UnityEngine.EventSystems.EventSystem:Update()
recv router info: { “t” : “HttpGetRouterResponse”, “Realms” : [“192.168.1.44:30002”], “Routers” : [“127.0.0.1:30301”, “127.0.0.1:30302”, “127.0.0.1:30303”, “127.0.0.1:30304”] }System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)ET.ThreadSynchronizationContext:Update()ET.Game:Update()
start get router info finish: { “t” : “HttpGetRouterResponse”, “Realms” : [“192.168.1.44:30002”], “Routers” : [“127.0.0.1:30301”, “127.0.0.1:30302”, “127.0.0.1:30303”, “127.0.0.1:30304”] }System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:Log(Object)ET.Log:Debug(String)ET.ThreadSynchronizationContext:Update()ET.Game:Update()
System.Exception: entity already has component: ET.Client.NetClientComponent at ET.Entity.AddComponentWithId[K,P1] (System.Int64 id, P1 p1, System.Boolean isFromPool) [0×00000] in <00000000000000000000000000000000>:0 at ET.Entity.AddComponent[K,P1] (P1 p1, System.Boolean isFromPool) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.LoginHelper.Login (ET.Scene clientScene, System.String account, System.String password) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterAddressComponentSystem.Init (ET.Client.RouterAddressComponent self) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.RouterAddressComponentSystem.GetAllRouter (ET.Client.RouterAddressComponent self) [0×00000] in <00000000000000000000000000000000>:0 at ET.Client.HttpClientHelper.Get (System.String link) [0×00000] in <00000000000000000000000000000000>:0 at ET.ThreadSynchronizationContext.Update () [0×00000] in <00000000000000000000000000000000>:0 at ET.Game.Update () [0×00000] in <00000000000000000000000000000000>:0 ET.Client.<Get>d__0:MoveNext()System.Diagnostics.StackFrame:.ctor(Int32, Boolean)System.Diagnostics.StackTrace:init_frames(Int32, Boolean)UnityEngine.StackTraceUtility:ExtractStackTrace()UnityEngine.Logger:Log(LogType, Object)UnityEngine.Debug:LogError(Object)ET.Logger:Error(Exception)ET.ThreadSynchronizationContext:Update()ET.Game:Update()