Skip to content

Instantly share code, notes, and snippets.

@Corgan
Created June 8, 2011 05:46
Show Gist options
  • Save Corgan/1013850 to your computer and use it in GitHub Desktop.
Save Corgan/1013850 to your computer and use it in GitHub Desktop.
def post_init
packet = PlayServerConnect.new()
packet.id = "100002351842512"
packet.zhash = "228ae84f6d2cba7900ed11858e97c2cc"
sendMessage(MESSAGE_PLAYSERVERCONNECT, packet)
end
def sendMessage(type, data)
header = Header.new()
header.magic = MAGIC
header.type = type
header.sender_id = 0
header.payload_length = data.num_bytes
puts "Sending: #{data.inspect}"
send_data(header.to_binary_s + data.to_binary_s)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment