improve getting areas on handshake

This commit is contained in:
cidoku 2025-03-12 14:18:34 -03:00
parent bf7248943e
commit 68cae6a24e

View File

@ -128,9 +128,9 @@ def handle_packets(caller, total, record=True):
caller.parent.ooclogin.setText("Lo&gin") caller.parent.ooclogin.setText("Lo&gin")
caller.OOC_Log.emit("<b>%s</b>" % (statusStrings[status+1])) caller.OOC_Log.emit("<b>%s</b>" % (statusStrings[status+1]))
elif header == "CHECK": #ping # elif header == "CHECK": #ping
pingafter = time.time() # pingafter = time.time()
caller.parent.gotPing.emit(int((pingafter - pingbefore)*1000)) # caller.parent.gotPing.emit(int((pingafter - pingbefore)*1000))
elif header == 'DONE': elif header == 'DONE':
caller.showCharSelect.emit() caller.showCharSelect.emit()
@ -162,7 +162,7 @@ def handle_packets(caller, total, record=True):
areaitem = QtGui.QListWidgetItem() areaitem = QtGui.QListWidgetItem()
caller.parent.areaitems.addItem(areaitem) caller.parent.areaitems.addItem(areaitem)
for j in range(len(network)): for j in range(4):
if j != kind: if j != kind:
caller.parent.areas[j].append("") caller.parent.areas[j].append("")
@ -171,21 +171,7 @@ def handle_packets(caller, total, record=True):
caller.parent.allMusic() caller.parent.allMusic()
for i in range(caller.parent.areas_len): caller.parent.update_area_list()
area_players = caller.parent.areas[0][i]
area_status = caller.parent.areas[1][i].title()
area_cm = caller.parent.areas[2][i].decode('utf-8')
area_locked = caller.parent.areas[3][i].title()
area_name = caller.parent.areas[4][i].decode('utf-8')
if area_status == "Casing":
caller.parent.areaitems.item(i).setText("%s\n%s | %s\n%s users | %s" % (area_name, area_status, area_cm, area_players, area_locked))
else:
caller.parent.areaitems.item(i).setText("%s\n%s\n%s users | %s" % (area_name, area_status, area_players, area_locked))
if area_locked == "Locked":
caller.parent.areaitems.item(i).setIcon(QtGui.QIcon(AO2XPpath + "icons/" + "lock.png"))
else:
caller.parent.areaitems.item(i).setIcon(QtGui.QIcon(AO2XPpath + "icons/" + "house.png"))
elif header == 'TI': elif header == 'TI':
del network[0] del network[0]