move serverlist.txt to ao2xp root
This commit is contained in:
parent
8785f1ca81
commit
9b1cf2764b
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@ PyQt4-4.11.4-cp27-cp27m-win32.whl
|
||||
*.pyc
|
||||
*.zip
|
||||
*.ini
|
||||
*.txt
|
||||
*.sf2
|
||||
Thumbs.db
|
||||
.DS_Store
|
||||
|
10
mainmenu.py
10
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user