def postprocess_server_object_spawn(server, opcode, data): global node_objid, stop_count, gather_count (x, y, z, objid, unknown1, type_id, unknown2, unknown3, name_id, unknown4, unknown5, unknown6) = struct.unpack('=3f3IBH2IHB', data) if not node_objid and type_id == 400205: node_objid = objid gather_count = 2 constructors.client_target(server.client, node_objid) constructors.client_harvest(server.client, 0)
def preprocess_server_harvest_window(server, opcode, data): global node_objid, gather_count print 'havest_window' (item_id, objid, unknown, mode) = struct.unpack('=2IHB', data) try: if mode == 2 or mode == 4: constructors.client_harvest(server.client, -1) if gather_count > 0: gather_count -= 1 constructors.client_target(server.client, node_objid) constructors.client_harvest(server.client, 0) else: node_objid = None except: pass print 'blocked' return None
def target(client): print 'targeting' global node_objid constructors.client_target(client, node_objid)