Guest User

Untitled

a guest
Jul 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. # encoding: utf-8
  2. #
  3. # packets.py
  4. # pymc
  5. #
  6. # Created by Tyler Kennedy on 2010-12-20.
  7. # Copyright 2010 Tyler Kennedy. All rights reserved.
  8. #
  9.  
  10. from pymc.core.defines import PacketType
  11. from pymc.core.decorators import threaded
  12.  
  13. class Packets(object):
  14. @staticmethod
  15. @threaded
  16. def Login(writer, version, username, password, seed, dimension):
  17. with writer.lock:
  18. writer.write_byte(PacketType.Login)
  19. writer.write_int(version)
  20. writer.write_utf8(username)
  21. writer.write_utf8(password)
  22. writer.write_long(seed)
  23. writer.write_byte(dimension)
  24.  
  25. @staticmethod
  26. @threaded
  27. def Handshake(writer, token_or_user):
  28. with writer.lock:
  29. writer.write_byte(PacketType.Handshake)
  30. writer.write_utf8(token_or_user)
  31.  
  32. ....
Add Comment
Please, Sign In to add comment