dnhodges/BitTorrent-Ruby — pull request #6 by fiyarburst (2013-01-30 08:20:12+00:00)
Title: Tracker Code!

1) Parsed the tracker data- at least, everything until the peerlist.

*The ubuntu tracker seems to return it in the binary format (as opposed to the dictionary one, both of which are described on the wiki). I'm not sure what the dictionary form is supposed to look like, and so as long as it's not ALSO binary data, I'm fairly certain of this...

*Now we have to somehow parse this binary data as a series of six-byte IP address/port pairs (4 byte IP, 2 byte port. All big-endian). There should be fifty addresses.

2) Shuffled a few things around to be cleaner and reduce duplicate code.

*All of our test torrents are now in a directory called "torrent_files/".
So run using:
```> ruby HaikuTorrent.rb torrent_files/whatever.torrent```

*The peer_id now has a time-based format that's computed in the main file, saved in the config file (if one doesn't already exist) and passed to the tracker object. And the config file stuff actually works now.

*The info_hash is computed in the torrent "open" function, but no longer shows up in parse_metadata.