Skip to content

Commit

Permalink
added private servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Atillart-One committed Jun 23, 2022
1 parent 3b54641 commit 3fdaeae
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 73 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand All @@ -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
Expand All @@ -36,11 +35,12 @@ 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
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!
12 changes: 0 additions & 12 deletions accounts.ini

This file was deleted.

Binary file added files/ChampionsAshesServerJoiner.dll
Binary file not shown.
120 changes: 67 additions & 53 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,28 +112,25 @@ def set_appwindow(root):
Creates (if file doesn't exist) and reads the needed variables.
"""
Path("C:/ProgramData/AshesLauncher").mkdir(exist_ok=True)
if os.path.isfile("C:/ProgramData/AshesLauncher/settings.txt"):
settings_file = open("C:/ProgramData/AshesLauncher/settings.txt", "r")
dir_path = settings_file.read()
settings_file.close()
if os.path.isfile("settings.ini"):
config = configparser.ConfigParser()
config.read('settings.ini')
dir_path = config['settings']['Directory']
lastmod = config['settings']['LastMod']
else:
dir_path = os.path.abspath('.')
if os.path.isfile("C:/ProgramData/AshesLauncher/lastmod.txt"):
lastmod_file = open("C:/ProgramData/AshesLauncher/lastmod.txt", "r")
lastmod = lastmod_file.read()
lastmod_file.close()
else:
lastmod = ''


def onObjectClick(event):
os.system("taskkill /f /im git.exe")
sys.exit(0)


installing = 0
private_servers = 0

config = configparser.ConfigParser()
config.read('settings.ini')
private_servers = config['settings'].getboolean('use_private_servers')
gameRunner = ctypes.cdll.LoadLibrary('files/ChampionsAshesServerJoiner.dll')

def report_callback_exception(self, exc, val, tb):
messagebox.showerror("Error", message=str(val))
Expand All @@ -156,24 +153,23 @@ def check():
global dir_path
if os.path.isfile(dir_path + "/DarkSoulsIII.exe") is False:
if messagebox.askyesno("AshesLauncher", "Please select Game folder.") is True:
settings_file = open("C:/ProgramData/AshesLauncher/settings.txt", "w+")
config = configparser.ConfigParser()
config.read('settings.ini')
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:
sys.exit(0)

check()
global moddir
if os.path.isfile("C:/ProgramData/AshesLauncher/moddir.txt"):
moddir_file = open("C:/ProgramData/AshesLauncher/moddir.txt", "r")
moddir = moddir_file.read()
moddir_file.close()
else:
moddir = ''
config = configparser.ConfigParser()
config.read('settings.ini')
moddir = config['settings']['Mods']
if os.path.isdir(moddir) is False:
moddir = dir_path + '/AshesLauncher'
if moddir == '':
Expand Down Expand Up @@ -218,13 +214,10 @@ def play_mod(event):
def vanilla():
delete()
global private_servers
if private_servers == 0:
if private_servers is False:
webbrowser.open('steam://rungameid/374320')
elif os.path.isfile(os.path.abspath("./files/ds3os/Loader/loader.exe")):
subprocess.Popen(os.path.abspath("./files/ds3os/Loader/loader.exe"))
else:
messagebox.showerror("AshesLauncher", "DS3 Open Server not found. Please install it under the 'ds3os' "
"folder inside the 'files' folder.")
gameRunner.join(dir_path + "/DarkSoulsIII.exe")

def launch():
delete()
Expand Down Expand Up @@ -283,13 +276,10 @@ def launch():
shutil.copy("files/lazyLoad/lazyLoad.ini", dir_path + "/lazyLoad.ini")
shutil.copy("files/lazyLoad/dinput8.dll", dir_path + "/dinput8.dll")
global private_servers
if private_servers == 0:
if private_servers is False:
webbrowser.open('steam://rungameid/374320')
elif os.path.isfile(os.path.abspath("./ds3os/Loader/loader.exe")):
subprocess.Popen(os.path.abspath("./ds3os/Loader/loader.exe"))
else:
messagebox.showerror("AshesLauncher", "DS3 Open Server not found. Please install it under the 'ds3os' "
"folder inside the 'files' folder..")
gameRunner.join(dir_path + "/DarkSoulsIII.exe")

if git_enabled == 1:
class CloneProgress(git.RemoteProgress):
Expand Down Expand Up @@ -500,11 +490,13 @@ def migrate():
messagebox.showinfo("AshesLauncher", "Please select Game folder.")
browse()
else:
moddir_file = open("C:/ProgramData/AshesLauncher/moddir.txt", "w+")
config = configparser.ConfigParser()
config.read('settings.ini')
global moddir
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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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"""

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions settings.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[enable]
enable = False

[usernames]
steam username here = display name for launcher here

[settings]
directory =
mods =
lastmod =
use_private_servers = False

0 comments on commit 3fdaeae

Please sign in to comment.