public static void Start(string Receiving, IPEndPoint EP) { try { GameCommandObject obj = JsonConvert.DeserializeObject <GameCommandObject>(Receiving); EP.AddToSocketList(); } catch (Exception ex) { ConsoleMessage.WriteException(ex.Message, "GameCommander.cs", "Start"); } }
public static void SendTo(this GameCommandObject Value, IPEndPoint eps) { try { foreach (var item in FuzzyServer.SocketList) { UDPWorker.Client.Connect(item.Value.UDP_Socket); var Str = JsonConvert.SerializeObject(Value); UDPWorker.Client.SendTo(Encoding.UTF8.GetBytes(Str), item.Value.UDP_Socket); } } catch (Exception ex) { ConsoleMessage.WriteException(ex.Message, "GameCommander.cs", "SendTo"); } }