-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
27 lines (20 loc) · 1.09 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import requests
# TODO: Custom install locations
DEFAULT_INSTALL_DIR = "C:\Program Files (x86)\Disney\Disney Online\ToontownOnline"
if not os.path.exists(DEFAULT_INSTALL_DIR):
raise Exception("Please install Toontown Online through the installer first.")
headers = {
"User-Agent": "TTOManager - Automated Setup Utility"
}
params_data = requests.get("https://download.sunrise.games/parameters/parameters.txt", headers=headers).text
open(os.path.join(DEFAULT_INSTALL_DIR, "parameters.txt"), "w").write(params_data)
print("Pointed launcher to Sunrise servers.")
# Setup the workaround for connection hang
os.makedirs(os.path.join(DEFAULT_INSTALL_DIR, "hash_data"), exist_ok=True)
print("Added workaround for connection freeze on modern versions of Windows.")
# Finally, grab cnc-ddraw
ddraw_data = requests.get("https://raw.githubusercontent.com/rocketprogrammer/TTOManager/main/libs/cnc-ddraw/ddraw.dll").content
open(os.path.join(DEFAULT_INSTALL_DIR, "ddraw.dll"), "wb").write(ddraw_data)
print("Added cnc-ddraw display wrapper.\nToontown Online should be ready to go now.")
os.system("pause")