diff --git a/Font/SourceHanSansCN-Regular.otf.import b/Font/SourceHanSansCN-Regular.otf.import index 17d52d9..df26073 100644 --- a/Font/SourceHanSansCN-Regular.otf.import +++ b/Font/SourceHanSansCN-Regular.otf.import @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/SourceHanSansCN-Regular.otf-a74baadd242fcbfb4 Rendering=null antialiasing=1 generate_mipmaps=false +disable_embedded_bitmaps=true multichannel_signed_distance_field=false msdf_pixel_range=8 msdf_size=48 diff --git a/addons/EGFramework/Module/ProtocolTools/EGUDP.cs b/addons/EGFramework/Module/ProtocolTools/EGUDP.cs index 9ebca10..2a740de 100644 --- a/addons/EGFramework/Module/ProtocolTools/EGUDP.cs +++ b/addons/EGFramework/Module/ProtocolTools/EGUDP.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Net; +using System.Linq; using System.Net.Sockets; using System.Text; -using System.Threading.Tasks; - +using Godot; namespace EGFramework{ public class EGUDP : IEGFramework, IModule, IProtocolSend, IProtocolReceived { @@ -34,6 +33,7 @@ namespace EGFramework{ { UdpClient udpDevice = new UdpClient(localPort); UDPDevices.Add(localPort,udpDevice); + //udpDevice.EnableBroadcast = true; HandleUDPListenAsync(udpDevice); //StartListening(localPort); } @@ -54,6 +54,7 @@ namespace EGFramework{ { try { + //GD.Print("UDP listened in "+((IPEndPoint)client.Client.LocalEndPoint).Port); while (true) { UdpReceiveResult data = await client.ReceiveAsync(); @@ -63,21 +64,30 @@ namespace EGFramework{ ResponseMsgs.Enqueue(receivedMsgs); } } - catch (Exception) + catch (Exception e) { + GD.Print("Listen false by:"+e); } } public void SendByteData(string host,int port,byte[] data){ - UdpClient udpClient = new UdpClient(); + UdpClient udpClient; + if(UDPDevices.Count>0){ + udpClient = UDPDevices.First().Value; + }else{ + udpClient = new UdpClient(); + } try{ + GD.Print(udpClient.EnableBroadcast); udpClient.Send(data, data.Length, host, port); } catch ( Exception e ){ Godot.GD.Print(e.ToString()); } - udpClient.Close(); - udpClient.Dispose(); + if(UDPDevices.Count<=0){ + udpClient.Close(); + udpClient.Dispose(); + } } public void SendByteData(string destination,byte[] data){ SendByteData(destination.GetHostByIp(),destination.GetPortByIp(),data); @@ -118,6 +128,9 @@ namespace EGFramework{ public static void EGUDPListen(this IEGFramework self ,int port){ self.GetModule().ListenUDP(port); } + public static void EGUDPEndListen(this IEGFramework self ,int port){ + self.GetModule().EndListenUDP(port); + } } } diff --git a/project.godot b/project.godot index c92605d..1a808f9 100644 --- a/project.godot +++ b/project.godot @@ -88,4 +88,5 @@ jump={ [rendering] +renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility"