public void Send(byte[] data, int id) { var writer = new BigEndianWriter(data); MessagePacking pack = new MessagePacking(); pack.Pack(id, writer); if (Client.Runing) { Client.Send(writer.Data); } }
public virtual void Send(NetworkMessage message) { var writer = new BigEndianWriter(); MessagePacking pack = new MessagePacking(); pack.Pack(message, writer); if (logger) { ConsoleLogger.Debug("Sent : " + message.ToString().Split('.').Last()); } if (Client.Runing && Client.Socket.Connected) { Client.Send(writer.Data); } if (Client.Runing == false || Client.Socket.Connected == false) { this.Dispose(); } }