public static void Free(BaseClientMessage msg) { pool.Free(msg); }
public static void FreeSafe(BaseClientMessage msg) { safePool.Free(msg); }
/// <summary> /// Sends an unformatted message to the connected server. /// </summary> /// <param name="message"></param> protected void SendMessage(BaseClientMessage message) { if (!isConnected) throw new InvalidOperationException("Can't send message in disconnected state!"); byte[] bytes = serializer.Serialize(message); lock (client) { NetOutgoingMessage sendBuffer = client.CreateMessage(bytes.Length); sendBuffer.Write(bytes, 0, bytes.Length); client.SendMessage(sendBuffer, message.DeliveryMethod); } BaseClientMessage.Free(message); }