1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 23:26:32 +09:00

NetOutgoingMessage.Write(string) now preallocates the correct amount of memory

NetPeer.MessageAvailable added
This commit is contained in:
lidgren
2010-08-07 07:46:06 +00:00
parent 44089457f9
commit ffe86262c6
3 changed files with 17 additions and 3 deletions

View File

@@ -150,6 +150,19 @@ namespace Lidgren.Network
Thread.Sleep(3);
}
/// <summary>
/// Returns true if there is a queued message available to read using ReadMessage()
/// </summary>
public bool MessageAvailable
{
get
{
if (m_status == NetPeerStatus.NotRunning)
return false;
return (m_releasedIncomingMessages.Count > 0);
}
}
/// <summary>
/// Read a pending message from any connection, if any
/// </summary>