From 9b1cf2764b30cd637d48c2dd38f60a8cf4d97678 Mon Sep 17 00:00:00 2001 From: cidoku Date: Fri, 20 Jun 2025 01:59:27 -0400 Subject: [PATCH] move serverlist.txt to ao2xp root --- .gitignore | 1 + mainmenu.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a4c5e8a..4fb6312 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ PyQt4-4.11.4-cp27-cp27m-win32.whl *.pyc *.zip *.ini +*.txt *.sf2 Thumbs.db .DS_Store diff --git a/mainmenu.py b/mainmenu.py index 1b50d18..eebda22 100644 --- a/mainmenu.py +++ b/mainmenu.py @@ -48,8 +48,8 @@ class lobby(QtGui.QWidget): self.autoconnect = None - if exists(AOpath+'serverlist.txt'): - with open(AOpath+'serverlist.txt') as file: + if exists('serverlist.txt'): + with open('serverlist.txt') as file: self.favoriteslist = [line.rstrip().split(':') for line in file] autoconnect_id = ini.read_ini_int("AO2XP.ini", "General", "auto connect", -1) @@ -267,8 +267,8 @@ class lobby(QtGui.QWidget): self.lobbychatlog.append('Failed to refresh server list.') elif self.tab == 1: - if exists(AOpath+'serverlist.txt'): - with open(AOpath+'serverlist.txt') as file: + if exists('serverlist.txt'): + with open('serverlist.txt') as file: self.favoriteslist = [ line.rstrip().split(':') for line in file ] else: self.favoriteslist = ['127.0.0.1:27017:your server (port 27017)'.split(':'), '0.0.0.0:27017:serverlist.txt not found on base folder'.split(':')] @@ -292,7 +292,7 @@ class lobby(QtGui.QWidget): return QtGui.QMessageBox.information(self, "Error", "This server already exists in your favorites list, named '%s'" % sv[2]) self.favoriteslist.append([ip, port, ws, wss, name]) - with open(AOpath+'serverlist.txt', "a") as file: + with open('serverlist.txt', "a") as file: file.write("%s:%s:%s:%s:%s\n" % (ip, port, ws, wss, name)) file.close()