diff --git a/Lidgren.Network/NetPeer.Internal.cs b/Lidgren.Network/NetPeer.Internal.cs index 857131c..22e60d5 100644 --- a/Lidgren.Network/NetPeer.Internal.cs +++ b/Lidgren.Network/NetPeer.Internal.cs @@ -50,6 +50,8 @@ namespace Lidgren.Network private void InitializeNetwork() { + VerifyNetworkThread(); + lock (m_initializeLock) { m_configuration.Lock(); diff --git a/Lidgren.Network/NetPeer.cs b/Lidgren.Network/NetPeer.cs index 7c7ba69..1bedc4c 100644 --- a/Lidgren.Network/NetPeer.cs +++ b/Lidgren.Network/NetPeer.cs @@ -13,6 +13,7 @@ namespace Lidgren.Network private static int s_initializedPeersCount; private int m_listenPort; + private object m_tag; internal readonly List m_connections; private readonly Dictionary m_connectionLookup; @@ -42,6 +43,15 @@ namespace Lidgren.Network /// public int Port { get { return m_listenPort; } } + /// + /// Gets or sets the application defined object containing data about the peer + /// + public object Tag + { + get { return m_tag; } + set { m_tag = value; } + } + /// /// Gets a copy of the list of connections ///