improve getting areas on handshake
This commit is contained in:
parent
0975d9c209
commit
bf7248943e
20
gameview.py
20
gameview.py
@ -1581,6 +1581,7 @@ class GUI(QtGui.QWidget):
|
|||||||
self.specialstream = 0
|
self.specialstream = 0
|
||||||
self.download_thread = None
|
self.download_thread = None
|
||||||
self.tcp = None
|
self.tcp = None
|
||||||
|
self.demo_player = None
|
||||||
|
|
||||||
# Finally, load the theme
|
# Finally, load the theme
|
||||||
self.width = 820
|
self.width = 820
|
||||||
@ -2776,6 +2777,7 @@ class GUI(QtGui.QWidget):
|
|||||||
self.inboxqueue = []
|
self.inboxqueue = []
|
||||||
self.inboxqueue.append(m_chatmessage)
|
self.inboxqueue.append(m_chatmessage)
|
||||||
self.inbox_timer.stop()
|
self.inbox_timer.stop()
|
||||||
|
self.chat_tick_timer.stop()
|
||||||
self.m_chatmessage = m_chatmessage
|
self.m_chatmessage = m_chatmessage
|
||||||
|
|
||||||
objections = ["holdit", "objection", "takethat", "custom_objections/"+custom_objection if custom_objection != "custom" else "custom"]
|
objections = ["holdit", "objection", "takethat", "custom_objections/"+custom_objection if custom_objection != "custom" else "custom"]
|
||||||
@ -3846,6 +3848,7 @@ class GUI(QtGui.QWidget):
|
|||||||
areaitem = QtGui.QListWidgetItem()
|
areaitem = QtGui.QListWidgetItem()
|
||||||
self.areaitems.addItem(areaitem)
|
self.areaitems.addItem(areaitem)
|
||||||
self.allMusic()
|
self.allMusic()
|
||||||
|
self.update_area_list()
|
||||||
else:
|
else:
|
||||||
self.no_arup = True
|
self.no_arup = True
|
||||||
|
|
||||||
@ -3953,3 +3956,20 @@ class GUI(QtGui.QWidget):
|
|||||||
self.changechar.setText('Disconnect')
|
self.changechar.setText('Disconnect')
|
||||||
else:
|
else:
|
||||||
self.changechar.setText('Switch &character')
|
self.changechar.setText('Switch &character')
|
||||||
|
|
||||||
|
def update_area_list(self):
|
||||||
|
for i in range(self.areas_len):
|
||||||
|
area_players = self.areas[0][i]
|
||||||
|
area_status = self.areas[1][i].title()
|
||||||
|
area_cm = self.areas[2][i].decode('utf-8')
|
||||||
|
area_locked = self.areas[3][i].title()
|
||||||
|
area_name = self.areas[4][i].decode('utf-8')
|
||||||
|
if area_status == "Casing":
|
||||||
|
self.areaitems.item(i).setText("%s\n%s | %s\n%s users | %s" % (area_name, area_status, area_cm, area_players, area_locked))
|
||||||
|
else:
|
||||||
|
self.areaitems.item(i).setText("%s\n%s\n%s users | %s" % (area_name, area_status, area_players, area_locked))
|
||||||
|
|
||||||
|
if area_locked == "Locked":
|
||||||
|
self.areaitems.item(i).setIcon(QtGui.QIcon(AO2XPpath + "icons/" + "lock.png"))
|
||||||
|
else:
|
||||||
|
self.areaitems.item(i).setIcon(QtGui.QIcon(AO2XPpath + "icons/" + "house.png"))
|
22
mainmenu.py
22
mainmenu.py
@ -448,9 +448,12 @@ class AOServerInfo(QtCore.QThread):
|
|||||||
features = []
|
features = []
|
||||||
evidence = []
|
evidence = []
|
||||||
playerlist = {}
|
playerlist = {}
|
||||||
|
musiclist = []
|
||||||
pingtimer = 150
|
pingtimer = 150
|
||||||
readytick = -1
|
readytick = -1
|
||||||
|
|
||||||
|
got_arup = False
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if self.disconnect:
|
if self.disconnect:
|
||||||
try: self.tcp.close()
|
try: self.tcp.close()
|
||||||
@ -594,16 +597,21 @@ class AOServerInfo(QtCore.QThread):
|
|||||||
elif header == "ARUP":
|
elif header == "ARUP":
|
||||||
del network[0]
|
del network[0]
|
||||||
kind = int(network[0])
|
kind = int(network[0])
|
||||||
areas[kind] = [network[i] for i in range(1, len(network))]
|
|
||||||
|
del network[0]
|
||||||
|
areas[kind] = [network[i] for i in range(len(network))]
|
||||||
areas_len = len(areas[kind])
|
areas_len = len(areas[kind])
|
||||||
print '[client]', 'The server has %d areas' % areas_len
|
|
||||||
|
|
||||||
for i in areas_len:
|
for i in range(areas_len):
|
||||||
for j in range(len(network)):
|
for j in range(4):
|
||||||
if j != kind:
|
if j != kind and not len(areas[j]):
|
||||||
caller.parent.areas[j].append("")
|
areas[j] = ["" for i in range(len(network))]
|
||||||
|
|
||||||
if musiclist:
|
if not got_arup:
|
||||||
|
print '[client]', 'The server has %d areas' % areas_len
|
||||||
|
got_arup = True
|
||||||
|
|
||||||
|
if musiclist and not len(areas[4]):
|
||||||
for i in range(areas_len):
|
for i in range(areas_len):
|
||||||
areas[4].append(musiclist[0])
|
areas[4].append(musiclist[0])
|
||||||
del musiclist[0]
|
del musiclist[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user