Пример #1
0
def packet_handshake(protocol_version, username, host, port):
    packet = '\x02' + data_type_parser.byte(
        protocol_version) + data_type_parser.string16(
            username) + data_type_parser.string16(host) + data_type_parser.int(
                port)
    return packet
Пример #2
0
def packet_chat_message(msg):
    packet = '\x03' + data_type_parser.string16(msg)
    return packet
Пример #3
0
def packet_disconnect(reason="Disconnected by user!"):
    packet='\xff'+data_type_parser.string16(reason)
    return packet
Пример #4
0
def packet_chat_message(msg):
    packet = '\x03' + data_type_parser.string16(msg)
    return packet
Пример #5
0
def packet_handshake(protocol_version, username, host, port):
    packet = '\x02'+data_type_parser.byte(protocol_version)+data_type_parser.string16(username) + data_type_parser.string16(host) +data_type_parser.int(port)
    return packet
Пример #6
0
def packet_disconnect(reason="Disconnected by user!"):
    packet = '\xff' + data_type_parser.string16(reason)
    return packet