import struct import logging from .. import glob from ..helpers import dataHelper logger = logging.getLogger(__name__) logger.propagate = False # Disable console logging def handle(client, data): ping_ip = ".".join((str(x) for x in struct.unpack(b"<4B", data[4:8]))) ping_port = struct.unpack(b" Pinging to %s:%d" % (client.addr, ping_ip, ping_port)) if len(data) == 11: # We should add our data ontop if data[-1:] in RESPONSE: data += RESPONSE[data[-1:]]() logger.debug("[%s] <- %s" % (client.addr, data)) return data def query_i(): len_hostname = len(glob.config["server"]["hostname"]) len_mode = len(glob.config["server"]["mode"]) len_language = len(glob.config["server"]["language"]) packet = struct.pack(b"