Created
November 16, 2010 08:13
-
-
Save mkroman/701578 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'socket' | |
DefaultHost = 'dpmaster.deathmask.net' | |
DefaultPort = 27950 | |
ChunkSize = 2**16 | |
UDPSocket.new.tap do |socket| | |
socket.connect DefaultHost, DefaultPort | |
socket.send "\xFF\xFF\xFF\xFFgetservers Warsow 11 full empty \0", 0 | |
if data = socket.recvfrom(ChunkSize)[0] | |
puts data.bytes.to_a.map{ |c| c.to_s(16).rjust 2, '0' }.join(' ').upcase | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment