def command(thread): print 'Handshake' thread.ProtocolVersion = tuxcraft_tools.minecraft_read_byte(thread.channel) thread.Username = tuxcraft_tools.minecraft_read_string(thread.channel) thread.ServerHost = tuxcraft_tools.minecraft_read_string(thread.channel) thread.ServerPort = tuxcraft_tools.minecraft_read_int(thread.channel) print thread.ProtocolVersion, thread.Username, thread.ServerHost, thread.ServerPort #thread.channel.send( b'\xff' + tuxcraft_tools.minecraft_string(u'Du identifierade dig') ) #time.sleep(5) # The procol docs state that this is necessery due to a bug in the client thread.send( b'\x01' + struct.pack('>i', 1238) + tuxcraft_tools.minecraft_string(u'default') + b'\x00\x00\x00\x00\x08' )
def command(thread): print 'Locale and View Distance' thread.Locale = tuxcraft_tools.minecraft_read_string(thread.channel) thread.ViewDistance = tuxcraft_tools.minecraft_read_byte(thread.channel) thread.ChatFlags = tuxcraft_tools.minecraft_read_byte(thread.channel) thread.Difficulty = tuxcraft_tools.minecraft_read_byte(thread.channel) print thread.Locale, thread.ViewDistance, thread.ChatFlags, thread.Difficulty if thread.sent_chunks == 0: thread.sent_chunks = 1 x = -7 z = -7 while True: thread.chunker.send_chunk(thread, x, z) x += 1 if x == 8: x = -7 z += 1 if z == 8: break thread.send(struct.pack('>biii', 0x06, 0, 128, 0)) thread.send(struct.pack('>bddddffb', 0x0D, 0, 67.240000009536743, 128, 0, 0, 0, 1))
def command(thread): print 'Pluginmessage' channel = tuxcraft_tools.minecraft_read_string(thread.channel) # Message string length = tuxcraft_tools.minecraft_read_short(thread.channel) # Message string data = thread.channel.recv(length) # Message string
def command(thread): print 'Chat Message ' + tuxcraft_tools.minecraft_read_string(thread.channel) # Message string
def command(thread): print 'Tab completion ' input = tuxcraft_tools.minecraft_read_string(thread.channel) # Message string thread.send(b'\xCB' + tuxcraft_tools.minecraft_string(input))