From c29270a5cf33758cc8c532c64d1e066564553840 Mon Sep 17 00:00:00 2001 From: lidgren Date: Wed, 3 Nov 2010 11:27:00 +0000 Subject: [PATCH] Tag added to NetPeer --- Lidgren.Network/NetPeer.Internal.cs | 2 ++ Lidgren.Network/NetPeer.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) 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 ///