public void Send(ISCMessage message) { var writer = new BigEndianWriter(); writer.WriteInt((int)message.RequestId); writer.WriteInt((int)message.MessageId); ConsoleLogger.Debug("[ISC] Sent : " + message.ToString().Split('.').Last()); message.Serialize(writer); if (m_client.Runing) { m_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(); } }