private void LoadSupports(BEncodedDictionary supports) { ExtensionSupports list = new ExtensionSupports(); foreach (KeyValuePair <BEncodedString, BEncodedValue> k in supports) { list.Add(new ExtensionSupport(k.Key.Text, (byte)((BEncodedNumber)k.Value).Number)); } this.supports = list; }
public ExtendedHandshakeMessage(bool privateTorrent, int metadataSize) : base(Support.MessageId) { supports = new ExtensionSupports(ExtensionMessage.SupportedMessages); if (privateTorrent) { supports.Remove(PeerExchangeMessage.Support); } this.metadataSize = metadataSize; }
public ExtendedHandshakeMessage(bool privateTorrent, int metadataSize, int localListenPort) : base(Support.MessageId) { Supports = new ExtensionSupports(SupportedMessages); if (privateTorrent) { Supports.Remove(PeerExchangeMessage.Support); } MetadataSize = metadataSize; LocalPort = localListenPort; }
public ExtendedHandshakeMessage() : base(Support.MessageId) { supports = new ExtensionSupports(); }