From 3fdaeaedf6752cfb1537cf2845a1b4935cad4bef Mon Sep 17 00:00:00 2001 From: Atillart-One Date: Thu, 23 Jun 2022 23:00:45 +0530 Subject: [PATCH] added private servers --- README.md | 16 ++-- accounts.ini | 12 --- files/ChampionsAshesServerJoiner.dll | Bin 0 -> 22016 bytes main.py | 120 +++++++++++++++------------ settings.ini | 12 +++ 5 files changed, 87 insertions(+), 73 deletions(-) delete mode 100644 accounts.ini create mode 100644 files/ChampionsAshesServerJoiner.dll create mode 100644 settings.ini diff --git a/README.md b/README.md index 81618c4..00222e0 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,8 @@ A launcher for the Dark Souls III mod Champion's Ashes, made by atillart#4807. ## Instructions To use, simply extract into a folder and run AshesLauncher4.exe. -If you have an older non-launcher manual install, delete the Ashes folder inside the AshesLauncher folder from your Game folder, or select another mod directory. -If you recieve any error while trying to launch the mod from a manual install, try pressing "Reset All Files" present under the MODS tab first. -The launcher temporarily freezing after pressing it is completely normal. +If you have a manual installation without launcher support, delete the Ashes folder inside the AshesLauncher folder from your Game folder, or select another mod directory. +If you receive any error while trying to launch the mod from a manual install, try pressing "Reset All Files" present under the MODS tab first. It may take a while and the launcher will be unresponsive during that time. ## Using Other Mods To utilize other mods when not playing Champion's Ashes, simply put the mods in their own folders inside the AshesLauncher folder (can be changed by selecting mods path in MODS tab.) @@ -18,14 +17,14 @@ Convergence example: These files are all present in a folder named "The Convergence" (can be named anything) inside the mods folder. ## Switching Accounts -To switch accounts, open the accompanying accounts.ini in your launcher folder and change enabled = False to enabled = True. +To switch accounts, open the included settings.ini in your launcher folder and change enabled = False to enabled = True. Under usernames, follow the instructions to add your accounts. ## Additional Notes -The Champion's Ashes mod WILL ban you if you have it enabled and launch the game. Make sure it's disabled before using an account that you don't want banned. -The DS3 Open Server can be updated by replacing the files inside the ds3os folder. +The Champion's Ashes mod WILL ban you if you used on the official servers. The official Champion's Ashes private server can be enabled through the launcher. If you need to disable installing/updating Champion's Ashes, simply delete the Git folder in the files folder present in the launcher folder. -Storing mods outside the Game folder requires the launcher to be run with Administrator privileges. Simply right click AshesLauncher4.exe and select run as admin. +Storing mods outside the Game folder requires the launcher to be run with Administrator privileges. Simply right click AshesLauncher4.exe and select run as admin. +Private server joiner can be updated by replacing the file 'ChampionsAshesServerJoiner.dll' present in the files folder. ## Links Changelog: https://docs.google.com/document/d/1j4UVY_1E6jqCX-sthQ467BGq67YmGrjx1I5huEmtciA @@ -36,6 +35,7 @@ Discord: https://discord.gg/xEMdvaTVc3 The Champion's Ashes team (Champion's Ashes) Church Guard (Lazy Loader: https://www.nexusmods.com/darksouls3/mods/677) TLeonardUK (Dark Souls III Open Server: https://github.com/TLeonardUK/ds3os) +Indie-ana Jones#5411 (Champion's Ashes Server Joiner DLL) Featuring background images from: Nobody#6945 @@ -43,4 +43,4 @@ ultimate life form#8606 Great Mighty p0#0001 Lunar#7499 -Special Thanks to ro/en#0591 for testing the launcher! +Special Thanks to ro/en#0591 for testing the launcher! \ No newline at end of file diff --git a/accounts.ini b/accounts.ini deleted file mode 100644 index aabe343..0000000 --- a/accounts.ini +++ /dev/null @@ -1,12 +0,0 @@ -; This file contains the usernames and their labels used by the launcher to switch accounts. - -[enable] -; Set to True to use. -enable = False - -[usernames] -; Add accounts by adding lines in the format 'username = label'. -; where username is your steam username and label is the name that will be displayed for it in the launcher. -; For example, the below line will show up with the name 'modded' in the launcher and log into the account with the username 'darksoulsalt'. -; darksoulsalt = modded -steam username here = display name for launcher here \ No newline at end of file diff --git a/files/ChampionsAshesServerJoiner.dll b/files/ChampionsAshesServerJoiner.dll new file mode 100644 index 0000000000000000000000000000000000000000..4b1f2909586bcd721e83ecb77ec4bc4ea228286a GIT binary patch literal 22016 zcmeHvd0<=RmG8M%yKKvro!BO;LN<}b@sijMB*d~T+e*B}TO6P`vMt++Wywf#5|aXE zpO&R8Nq`nYSO;24frioy6ap=jKq*fnE5Xb+HHGb){m9C7iP8g zhvKfGShOz|7<6?9B9Umq)fIHbh9j;}#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%C54qz_RXTr8p=r4HlL!pRBa1SuF#h zAy~qz1KLwX1@D+}Xo+U)N{UKL%exkrmIligFAXd$SzO*z+`YKCw4|`Nw5V%& zS#K|Xsfd>;i?k*Z)#E*(f(Bpf*qaoKl2O19#>xtc;jm-Un2^5-#RGcY=1<~Mt}%&A zw2cW#9;n9H6Vt4jvSz^zy81>1?*^|$yjQ>pOHX5Z-4%pE{ z0Hd7I+M7gfEGWrO1LLkFHSu1NqBl{3ZIlpnRXpTBz5RQt!lq|5s3R zldn|4o8I@wV0xSQ|=l_WaXzxho z%Lqwzm}e^F!3p@RRg0@*7twt@+v}hE3^?^-^WTEKYCAUee9+}XOao{>`c?zy&rgi+ zf2m~|*T5g`j-LX{2P*+DSQ9=~pcGi;g*Um_`?1sGeLa8X5SMC|4FMmRc>kN+tBV3X zU`&UvifjpZr^x%t<1M|5iWRgv`L`5%V#EONR&qSN`gTD(Gsur*Av-xm#=GGNP7w{b z^PV^PIa}VlOx9NgNgSIG_G4&*pI)32xFqlM`J91wlyLFM0WSprCQmi1A>}qOhd+h9 zdmC#{yYS<>4VLrs3GKNC--*t~o1pleAT02v2;cjl)^Li~{}n$9a5CXD6n|>*-l~G* zU=UGe%N)5O#6{bq_oG%i0ndfE>s|OOhL6SgBmAb9<34Uj>tR0S@o9|DG|65du`EMG54ch= 83: mod_path.set("..." + moddir[-80:]) else: @@ -558,18 +550,22 @@ def browse(): def check(): global dir_path - settings_file = open("C:/ProgramData/AshesLauncher/settings.txt", "w+") + config = configparser.ConfigParser() + config.read('settings.ini') + if os.path.isfile(dir_path + "/DarkSoulsIII.exe") is False: if messagebox.askyesno("AshesLauncher", "Please select Game folder.") is True: dir_path = filedialog.askdirectory() if os.path.isfile(dir_path + "/DarkSoulsIII.exe") is False: check() else: - settings_file.write(dir_path) - settings_file.close() + config.set('settings', 'Directory', dir_path) + with open('settings.ini', 'w+') as file: + config.write(file) else: - settings_file.write(dir_path) - settings_file.close() + config.set('settings', 'Directory', dir_path) + with open('settings.ini', 'w+') as file: + config.write(file) check() if len(dir_path) >= 83: @@ -578,17 +574,19 @@ def check(): game_path.set(dir_path) def browse_mod(): - moddir_file = open("C:/ProgramData/AshesLauncher/moddir.txt", "w+") + config = configparser.ConfigParser() + config.read('settings.ini') global moddir - moddir = filedialog.askdirectory() + moddir = config['settings']['Mods'] if os.path.isdir(moddir) is False: moddir = dir_path + '/AshesLauncher' if moddir == '/': moddir = dir_path + '/AshesLauncher' if os.path.isfile(moddir + '/DarkSoulsIII.exe') is True: moddir = dir_path + '/AshesLauncher' - moddir_file.write(moddir) - moddir_file.close() + config.set('settings', 'Mods', moddir) + with open('settings.ini', 'w+') as file: + config.write(file) if len(moddir) >= 83: mod_path.set("..." + moddir[-80:]) else: @@ -662,13 +660,21 @@ def preset_default(event): def server_toggle(event): global private_servers - if private_servers == 0: + config = configparser.ConfigParser() + config.read('settings.ini') + if private_servers is False: canvas.itemconfig(checkbox, image=tick) - private_servers = 1 + private_servers = True + config.set('settings', 'use_private_servers', 'True') + with open('settings.ini', 'w+') as file: + config.write(file) else: canvas.itemconfig(checkbox, image=box) - private_servers = 0 + private_servers = False + config.set('settings', 'use_private_servers', 'False') + with open('settings.ini', 'w+') as file: + config.write(file) """ Swap Tabs""" @@ -838,7 +844,13 @@ def get_bg(): canvas.create_image(650, 220, image=logo, tags='home', anchor=tkinter.NW) - checkbox = canvas.create_image(40, 630, image=box, anchor=tkinter.NW, tags='home') + global private_servers + if private_servers is True: + checkbox = canvas.create_image(40, 630, image=tick, anchor=tkinter.NW, tags='home') + + else: + checkbox = canvas.create_image(40, 630, image=box, anchor=tkinter.NW, tags='home') + canvas.create_text(75, 632, text='Use Private Servers', fill='#e4dfd4', justify=tkinter.CENTER, @@ -915,9 +927,11 @@ def patch_down(event): canvas.create_image(50, 100, image=mods_img, anchor=tkinter.NW, state='hidden', tags='mods') def modchosen(): - lastmod_file = open("C:/ProgramData/AshesLauncher/lastmod.txt", "w+") - lastmod_file.write(mod_name.get()) - lastmod_file.close() + config = configparser.ConfigParser() + config.read('settings.ini') + config.set('settings', 'LastMod', mod_name.get()) + with open('settings.ini', 'w+') as file: + config.write(file) def mod_creation(): for mod in os.listdir(moddir): @@ -1015,16 +1029,16 @@ def switch_account(): os.system("start steam:") winreg.CloseKey(registry_steam) - if os.path.isfile(os.path.abspath('./accounts.ini')): + if os.path.isfile('settings.ini'): config = configparser.ConfigParser() - config.read(os.path.abspath('./accounts.ini')) + config.read('settings.ini') if config['enable']['enable'] == 'True': canvas.create_image(680, 330, image=accs_img, state='hidden', anchor=tkinter.NW, tags='mods') registry_steam = winreg.CreateKey(winreg.HKEY_CURRENT_USER, r"Software\Valve\Steam") current_username = tkinter.StringVar(root, winreg.QueryValueEx(registry_steam, 'AutoLoginUser')[0]) winreg.CloseKey(registry_steam) config = configparser.ConfigParser() - config.read(os.path.abspath('./accounts.ini')) + config.read('settings.ini') for username in config['usernames']: radio = tkinter.Radiobutton(root, indicatoron=0, text=config['usernames'][username], variable=current_username, value=username, diff --git a/settings.ini b/settings.ini new file mode 100644 index 0000000..112db2e --- /dev/null +++ b/settings.ini @@ -0,0 +1,12 @@ +[enable] +enable = False + +[usernames] +steam username here = display name for launcher here + +[settings] +directory = +mods = +lastmod = +use_private_servers = False +