diff --git a/Assets/GameScripts/DotNet/Core/Network/Base/Enum/NetworkProtocolType.cs b/Assets/GameScripts/DotNet/Core/Network/Base/Enum/NetworkProtocolType.cs index 34bbd946..f6490555 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Base/Enum/NetworkProtocolType.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Base/Enum/NetworkProtocolType.cs @@ -4,6 +4,7 @@ namespace TEngine.Core.Network { None = 0, KCP = 1, - TCP = 2 + TCP = 2, + WebSocket = 3, } } \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/Base/Helper/NetworkHelper.cs b/Assets/GameScripts/DotNet/Core/Network/Base/Helper/NetworkHelper.cs index 83f70ef6..6a7c0dc0 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Base/Helper/NetworkHelper.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Base/Helper/NetworkHelper.cs @@ -2,7 +2,9 @@ using System; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; +#if !UNITY_WEBGL using System.Net.Sockets; +#endif using System.Runtime.InteropServices; // ReSharper disable InconsistentNaming @@ -49,6 +51,7 @@ namespace TEngine.Core return $"{self.Address}:{self.Port}"; } +#if !UNITY_WEBGL public static void SetSioUdpConnReset(Socket socket) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -70,5 +73,6 @@ namespace TEngine.Core socket.IOControl(SIO_UDP_CONNRESET, new[] {Convert.ToByte(false)}, null); } +#endif } } \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/Base/SocketExtensions.cs b/Assets/GameScripts/DotNet/Core/Network/Base/SocketExtensions.cs index a4b01440..5b571e8f 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Base/SocketExtensions.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Base/SocketExtensions.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System.Net.Sockets; namespace TEngine.Core.Network @@ -48,4 +49,5 @@ namespace TEngine.Core.Network } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/Entity/ClientNetworkComponent.cs b/Assets/GameScripts/DotNet/Core/Network/Entity/ClientNetworkComponent.cs index 1ce5efa5..939b88ba 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Entity/ClientNetworkComponent.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Entity/ClientNetworkComponent.cs @@ -13,7 +13,8 @@ namespace TEngine.Core.Network public void Initialize(NetworkProtocolType networkProtocolType, NetworkTarget networkTarget) { switch (networkProtocolType) - { + { +#if !UNITY_WEBGL case NetworkProtocolType.KCP: { Network = new KCPClientNetwork(Scene, networkTarget); @@ -24,6 +25,7 @@ namespace TEngine.Core.Network Network = new TCPClientNetwork(Scene, networkTarget); return; } +#endif default: { throw new NotSupportedException($"Unsupported NetworkProtocolType:{networkProtocolType}"); diff --git a/Assets/GameScripts/DotNet/Core/Network/Entity/ServerNetworkComponent.cs b/Assets/GameScripts/DotNet/Core/Network/Entity/ServerNetworkComponent.cs index 7fd9b5bd..ac7ae044 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Entity/ServerNetworkComponent.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Entity/ServerNetworkComponent.cs @@ -13,6 +13,7 @@ namespace TEngine.Core.Network { switch (networkProtocolType) { +#if !UNITY_WEBGL case NetworkProtocolType.KCP: { Network = new KCPServerNetwork(Scene, networkTarget, address); @@ -25,6 +26,7 @@ namespace TEngine.Core.Network // Log.Info($"NetworkProtocol:TCP IPEndPoint:{address}"); return; } +#endif default: { throw new NotSupportedException($"Unsupported NetworkProtocolType:{networkProtocolType}"); diff --git a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Client/KCPClientNetwork.cs b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Client/KCPClientNetwork.cs index dbef82d3..c91158ed 100644 --- a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Client/KCPClientNetwork.cs +++ b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Client/KCPClientNetwork.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System; using System.Buffers; using System.Collections.Generic; @@ -565,4 +566,5 @@ namespace TEngine.Core.Network #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetwork.cs b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetwork.cs index 57184341..2af57363 100644 --- a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetwork.cs +++ b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetwork.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System; using System.Collections.Generic; using System.IO; @@ -459,4 +460,5 @@ namespace TEngine.Core.Network #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetworkChannel.cs b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetworkChannel.cs index ae6c65db..9e3c2d86 100644 --- a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetworkChannel.cs +++ b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/KCP/Server/KCPServerNetworkChannel.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System; using System.Buffers; using System.IO; @@ -232,4 +233,5 @@ namespace TEngine.Core.Network #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Client/TCPClientNetwork.cs b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Client/TCPClientNetwork.cs index da60ac21..893a87b2 100644 --- a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Client/TCPClientNetwork.cs +++ b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Client/TCPClientNetwork.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System; using System.Collections.Generic; using System.IO; @@ -538,4 +539,5 @@ namespace TEngine.Core.Network #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetwork.cs b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetwork.cs index c6f4b35f..44b3fe2c 100644 --- a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetwork.cs +++ b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetwork.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System; using System.Collections.Generic; using System.IO; @@ -235,4 +236,5 @@ namespace TEngine.Core.Network #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetworkChannel.cs b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetworkChannel.cs index 22ab8c05..c7902e23 100644 --- a/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetworkChannel.cs +++ b/Assets/GameScripts/DotNet/Core/Network/NetworkProtocol/TCP/Server/TCPServerNetworkChannel.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL using System; using System.IO; using System.Net.Sockets; @@ -346,4 +347,5 @@ namespace TEngine.Core.Network #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/GameScripts/HotFix/GameLogic/GameApp.cs b/Assets/GameScripts/HotFix/GameLogic/GameApp.cs index 161baa98..ca677c6f 100644 --- a/Assets/GameScripts/HotFix/GameLogic/GameApp.cs +++ b/Assets/GameScripts/HotFix/GameLogic/GameApp.cs @@ -7,8 +7,6 @@ public partial class GameApp:Singleton { private static List _hotfixAssembly; - public Scene Scene { private set; get; } - /// /// 热更域App主入口。 /// diff --git a/Assets/GameScripts/HotFix/GameLogic/GameApp_RegisterSystem.cs b/Assets/GameScripts/HotFix/GameLogic/GameApp_RegisterSystem.cs index f05b6632..c9b51da3 100644 --- a/Assets/GameScripts/HotFix/GameLogic/GameApp_RegisterSystem.cs +++ b/Assets/GameScripts/HotFix/GameLogic/GameApp_RegisterSystem.cs @@ -22,6 +22,11 @@ public partial class GameApp } + /// + /// Entity框架根节点。 + /// + public Scene Scene { private set; get; } + /// /// 注册所有逻辑系统 ///