diff --git a/Documentation/Documentation.chm b/Documentation/Documentation.chm index 520cc46..8f39f07 100644 Binary files a/Documentation/Documentation.chm and b/Documentation/Documentation.chm differ diff --git a/Lidgren.Network/Lidgren.Network.csproj b/Lidgren.Network/Lidgren.Network.csproj index d9ae48b..548c867 100644 --- a/Lidgren.Network/Lidgren.Network.csproj +++ b/Lidgren.Network/Lidgren.Network.csproj @@ -54,6 +54,7 @@ + diff --git a/Lidgren.Network/NetBitVector.cs b/Lidgren.Network/NetBitVector.cs index 52bbfb5..0d1640a 100644 --- a/Lidgren.Network/NetBitVector.cs +++ b/Lidgren.Network/NetBitVector.cs @@ -151,6 +151,9 @@ namespace Lidgren.Network m_numBitsSet = 0; } + /// + /// Returns a string that represents this object + /// public override string ToString() { StringBuilder bdr = new StringBuilder(m_capacity + 2); diff --git a/Lidgren.Network/NetClient.cs b/Lidgren.Network/NetClient.cs index b40e60e..4c4b4dd 100644 --- a/Lidgren.Network/NetClient.cs +++ b/Lidgren.Network/NetClient.cs @@ -114,6 +114,9 @@ namespace Lidgren.Network return serverConnection.SendMessage(msg, method, sequenceChannel); } + /// + /// Returns a string that represents this object + /// public override string ToString() { return "[NetClient " + ServerConnection + "]"; diff --git a/Lidgren.Network/NetConnection.Handshake.cs b/Lidgren.Network/NetConnection.Handshake.cs index 57a9c77..7826218 100644 --- a/Lidgren.Network/NetConnection.Handshake.cs +++ b/Lidgren.Network/NetConnection.Handshake.cs @@ -343,6 +343,10 @@ namespace Lidgren.Network return true; } + /// + /// Disconnect from the remote peer + /// + /// the message to send with the disconnect message public void Disconnect(string byeMessage) { // user or library thread diff --git a/Lidgren.Network/NetConnection.cs b/Lidgren.Network/NetConnection.cs index 7bd1612..7abd3c0 100644 --- a/Lidgren.Network/NetConnection.cs +++ b/Lidgren.Network/NetConnection.cs @@ -416,6 +416,9 @@ namespace Lidgren.Network ExecuteDisconnect(reason, true); } + /// + /// Returns a string that represents this object + /// public override string ToString() { return "[NetConnection to " + m_remoteEndpoint + "]"; diff --git a/Lidgren.Network/NetConnectionStatistics.cs b/Lidgren.Network/NetConnectionStatistics.cs index a7e8081..f4ad610 100644 --- a/Lidgren.Network/NetConnectionStatistics.cs +++ b/Lidgren.Network/NetConnectionStatistics.cs @@ -106,6 +106,9 @@ namespace Lidgren.Network m_resentMessages++; } + /// + /// Returns a string that represents this object + /// public override string ToString() { StringBuilder bdr = new StringBuilder(); diff --git a/Lidgren.Network/NetEncryption.cs b/Lidgren.Network/NetEncryption.cs index bf71a34..f7b65f8 100644 --- a/Lidgren.Network/NetEncryption.cs +++ b/Lidgren.Network/NetEncryption.cs @@ -23,6 +23,9 @@ using System.Security; namespace Lidgren.Network { + /// + /// Methods to encrypt and decrypt data using the XTEA algorith + /// public sealed class NetXtea { private const int m_blockSize = 8; diff --git a/Lidgren.Network/NetIncomingMessage.cs b/Lidgren.Network/NetIncomingMessage.cs index 4d93f4d..99f308c 100644 --- a/Lidgren.Network/NetIncomingMessage.cs +++ b/Lidgren.Network/NetIncomingMessage.cs @@ -111,6 +111,9 @@ namespace Lidgren.Network m_data = result; } + /// + /// Returns a string that represents this object + /// public override string ToString() { return "[NetIncomingMessage #" + m_sequenceNumber + " " + this.LengthBytes + " bytes]"; diff --git a/Lidgren.Network/NetOutgoingMessage.cs b/Lidgren.Network/NetOutgoingMessage.cs index 6d42e5c..2ed5a5b 100644 --- a/Lidgren.Network/NetOutgoingMessage.cs +++ b/Lidgren.Network/NetOutgoingMessage.cs @@ -41,7 +41,7 @@ namespace Lidgren.Network { } - public void Reset() + internal void Reset() { m_messageType = NetMessageType.LibraryError; m_bitLength = 0; @@ -114,6 +114,9 @@ namespace Lidgren.Network return retval; } + /// + /// Encrypt this message using the XTEA algorithm; no more writing can be done before sending it + /// public void Encrypt(NetXtea tea) { // need blocks of 8 bytes @@ -130,6 +133,9 @@ namespace Lidgren.Network m_data = result; } + /// + /// Returns a string that represents this object + /// public override string ToString() { return "[NetOutgoingMessage " + m_messageType + " " + this.LengthBytes + " bytes]"; diff --git a/Lidgren.Network/NetPeerStatistics.cs b/Lidgren.Network/NetPeerStatistics.cs index af78bd4..9702802 100644 --- a/Lidgren.Network/NetPeerStatistics.cs +++ b/Lidgren.Network/NetPeerStatistics.cs @@ -117,6 +117,9 @@ namespace Lidgren.Network m_receivedMessages += numMessages; } + /// + /// Returns a string that represents this object + /// public override string ToString() { StringBuilder bdr = new StringBuilder(); diff --git a/Lidgren.Network/NetPeerStatus.cs b/Lidgren.Network/NetPeerStatus.cs index 5589184..382c124 100644 --- a/Lidgren.Network/NetPeerStatus.cs +++ b/Lidgren.Network/NetPeerStatus.cs @@ -26,9 +26,24 @@ namespace Lidgren.Network /// public enum NetPeerStatus { + /// + /// NetPeer is not running; socket is not bound + /// NotRunning = 0, + + /// + /// NetPeer is in the process of starting up + /// Starting = 1, + + /// + /// NetPeer is bound to socket and listening for packets + /// Running = 2, + + /// + /// Shutdown has been requested and will be executed shortly + /// ShutdownRequested = 3, } } diff --git a/Lidgren.Network/NetQueue.cs b/Lidgren.Network/NetQueue.cs index 0c3c9b8..547c301 100644 --- a/Lidgren.Network/NetQueue.cs +++ b/Lidgren.Network/NetQueue.cs @@ -23,7 +23,7 @@ using System.Diagnostics; namespace Lidgren.Network { /// - /// Thread safe (blocking) queue with TryDequeue() and EnqueueFirst() + /// Thread safe (blocking) expanding queue with TryDequeue() and EnqueueFirst() /// [DebuggerDisplay("Count={Count} Capacity={Capacity}")] public sealed class NetQueue @@ -47,18 +47,22 @@ namespace Lidgren.Network private int m_size; private int m_head; + /// + /// Gets the number of items in the queue + /// public int Count { get { return m_size; } } public int Capacity { get { return m_items.Length; } } public NetQueue(int initialCapacity) { + System.Collections.Generic.Queue a; m_lock = new object(); m_items = new T[initialCapacity]; } /// - /// Places an item last/tail of the queue + /// Adds an item last/tail of the queue /// public void Enqueue(T item) { @@ -163,6 +167,9 @@ namespace Lidgren.Network } } + /// + /// Determines whether an item is in the queue + /// public bool Contains(T item) { lock (m_lock) @@ -186,6 +193,9 @@ namespace Lidgren.Network return false; } + /// + /// Copies the queue items to a new array + /// public T[] ToArray() { lock (m_lock) @@ -202,6 +212,9 @@ namespace Lidgren.Network } } + /// + /// Removes all objects from the queue + /// public void Clear() { lock (m_lock) diff --git a/Lidgren.Network/NetServer.cs b/Lidgren.Network/NetServer.cs index 7162c15..347b548 100644 --- a/Lidgren.Network/NetServer.cs +++ b/Lidgren.Network/NetServer.cs @@ -12,5 +12,13 @@ namespace Lidgren.Network { config.AcceptIncomingConnections = true; } + + /// + /// Returns a string that represents this object + /// + public override string ToString() + { + return "[NetServer " + ConnectionsCount + " connections]"; + } } } diff --git a/Lidgren.Network/NetTime.cs b/Lidgren.Network/NetTime.cs index 986f9c8..494ab97 100644 --- a/Lidgren.Network/NetTime.cs +++ b/Lidgren.Network/NetTime.cs @@ -46,6 +46,9 @@ namespace Lidgren.Network public static double Now { get { return (double)Environment.TickCount / 1000.0; } } #endif + /// + /// Given seconds it will output a human friendly readable string (milliseconds if less than 60 seconds) + /// public static string ToReadable(double seconds) { if (seconds > 60)