36 lines
777 B
Python
36 lines
777 B
Python
import vona.globals as globals
|
|
import vona.config as config
|
|
import multiprocessing
|
|
|
|
versions = [str(i) for i in range(1, 10)]
|
|
desired_ver = input("Desired room version:\n\t")
|
|
|
|
if desired_ver not in versions:
|
|
print("Unsupported room version")
|
|
exit(1)
|
|
|
|
def worker(room_found):
|
|
try:
|
|
while not room_found.value:
|
|
room_id = globals.make_event_id().replace("$", "!")
|
|
room_ver = globals.room_version_from_id(room_id)
|
|
|
|
if room_ver == desired_ver:
|
|
print(room_id)
|
|
room_found.value = True
|
|
break
|
|
except Exception as e:
|
|
pass
|
|
|
|
|
|
room_found = multiprocessing.Value('b', False)
|
|
processes = []
|
|
|
|
for _ in range(multiprocessing.cpu_count()):
|
|
p = multiprocessing.Process(target=worker, args=(room_found,))
|
|
processes.append(p)
|
|
p.start()
|
|
|
|
for p in processes:
|
|
p.join()
|