public byte[] Serialize(ANetworkMessage data) { var _stream = new MemoryStream(); _formatter.Serialize(_stream, data); return(_stream.ToArray()); }
public bool StartBroadcast(int key, int port, ANetworkMessage message) { var packet = _formatter.Serialize(message); var broabcast = NetworkTransport.StartBroadcastDiscovery(Id, port, key, 1, 0, packet, packet.Length, 500, out byte error); ParseError("Failed to start broadcast", error); return(broabcast); }