/// <summary> /// Send a packet.</summary> /// <param name="packet">The packet that will be send</param> /// <param name="ssl">The ssl stream</param> public static bool SendPacket(Packet packet, SslStream ssl) { BinaryFormatter binairyFormatter = new BinaryFormatter(); try { binairyFormatter.Serialize(ssl, packet); ssl.Flush(); } catch (Exception) { return false; } return true; }
/// <summary> /// Send a packet to the server.</summary> /// <param name="packet">The packet that will be send</param> public void sendPacket(Packet packet) { NetworkCommunication.SendPacket(packet, ssl); }