title: Minecraft took too long to log in error when sending packets with Python
body: <p>Ok, so this is my code basicly:</p>
  
  <pre><code>class Server:
      def __init__(self, addr, port, mc):
          self.mc = mc
          data = {'user': mc.user, 'password': mc.pswd, 'version': '12'}
          data = urllib.urlencode(data)
          dta = urllib.urlopen("https://login.minecraft.net", data=data).read()
          dta = dta.split(":")
          self.sessionid = dta[3]
          self.socket = socket.socket()
          self.socket.connect((addr, port))
          data = {"user": mc.user, "host": addr, "port": port}
          enc = mc.user.encode('utf-16BE')
          structfmt = '!bh'
          bytes = struct.pack(structfmt, 2, len(enc))
          bytes = bytes + enc
          self.socket.send(self.get_login_packet(mc.user, mc.pswd, addr, port))
          self.random = False
          self.world = World()
      def test(self):
          self.socket.send(self.get_chat_packet(raw_input("Enter a message: ")))
          self.disconnect(raw_input("Enter the disconnect message: "))
      def keep_alive(self):
          if self.random:
              self.socket.send(struct.pack("!bi", 0, self.random))
      def get_login_packet(self, user, password, addr, port):
          data = {"user": mc.user, "host": addr, "port": port}
          enc = mc.user.encode('utf-16BE')
          structfmt = '!bh'
          bytes = struct.pack(structfmt, 2, len(enc))
          bytes = bytes + enc
          return bytes
      def get_chat_packet(self, message):
          if len(message) &gt; 100:
              message = message[:100]
          return struct.pack("!bs", 3, message)
      def get_disconnect_packet(self, message):
          return struct.pack("!bs", 0xFF, message)
      def disconnect(self, message):
          self.socket.send(self.get_disconnect_packet(message))
          time.sleep(0.1)
          self.socket.close()
  </code></pre>
  
  <p>mc is a Minecraft instance in python which basicly has 4 attributes, server (the class above), user, pswd, and world (for now, a None type).</p>
  
  <p>I am NOT trying to connect to a Minecraft Classic, I am trying to connect to the payed version. I am using Python 2.5 on Windows XP. The error it gave me when I tried to connect on the server is</p>
  
  <pre><code>[INFO] Disconnecting /127.0.0.1:2292: Took too long to log in
  [INFO] /127.0.0.1:2295 lost connection
  </code></pre>
  
  <p>The error on Python is </p>
  
  <pre><code>    self.socket.send(self.get_chat_packet(raw_input("Enter a message: ")))
  socket.error: (10053, 'Software caused connection abort')
  </code></pre>
  
  <p>Please tell me why this is happening and preferably how to fix it also. Thanks!</p>