63 lines
1.2 KiB
Python
63 lines
1.2 KiB
Python
import vona.globals as globals
|
|
import vona.config as config
|
|
import multiprocessing
|
|
|
|
versions = [str(i) for i in range(1, 10)]
|
|
|
|
try:
|
|
desired_ver = input("Desired room version:\n\t")
|
|
except (EOFError, KeyboardInterrupt):
|
|
print("")
|
|
exit(0)
|
|
|
|
known = {
|
|
"1": "qa",
|
|
"2": "br",
|
|
"3": "3",
|
|
"4": "D",
|
|
"5": "U",
|
|
"6": "f",
|
|
"7": "gx",
|
|
"8": "hx",
|
|
"9": "iy",
|
|
"10": "p0",
|
|
"11": "jZ",
|
|
}
|
|
|
|
if desired_ver in known:
|
|
print(f"!{known[desired_ver]}:{config.server_name} (from known room ID list)")
|
|
try:
|
|
input("Press enter to bruteforce anyway:\n\t")
|
|
except (EOFError, KeyboardInterrupt):
|
|
print("")
|
|
exit(0)
|
|
|
|
elif 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:
|
|
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()
|