2022-05-28 23:20:15 +00:00
|
|
|
import lib.code.version
|
2022-05-27 06:37:52 +00:00
|
|
|
import lib.code.packet
|
|
|
|
import lib.code.utils
|
|
|
|
import lib.download
|
|
|
|
import lib.extract
|
2022-05-07 23:26:19 +00:00
|
|
|
import sys
|
2022-05-07 21:54:02 +00:00
|
|
|
|
2022-05-28 23:20:15 +00:00
|
|
|
version_id = lib.code.version.get_version_id()
|
|
|
|
|
|
|
|
mappings = lib.download.get_mappings_for_version(version_id)
|
|
|
|
burger_data = lib.extract.get_burger_data_for_version(version_id)
|
2022-05-07 21:54:02 +00:00
|
|
|
|
|
|
|
burger_packets_data = burger_data[0]['packets']['packet']
|
2022-12-08 03:09:58 +00:00
|
|
|
packet_id, direction, state = int(sys.argv[1], 0), sys.argv[2], sys.argv[3]
|
2022-05-07 23:30:44 +00:00
|
|
|
print(
|
|
|
|
f'Generating code for packet id: {packet_id} with direction {direction} and state {state}')
|
2022-05-27 06:37:52 +00:00
|
|
|
lib.code.packet.generate_packet(burger_packets_data, mappings,
|
|
|
|
packet_id, direction, state)
|
2022-05-07 22:29:51 +00:00
|
|
|
|
2022-05-27 06:37:52 +00:00
|
|
|
lib.code.utils.fmt()
|
2022-05-07 23:26:19 +00:00
|
|
|
|
|
|
|
print('Done!')
|