diff --git a/gameview.py b/gameview.py index c48c17e..83dfa5a 100644 --- a/gameview.py +++ b/gameview.py @@ -1750,11 +1750,9 @@ class gui(QtGui.QWidget): msg += "%" - # Avoid duplicate messages - if self.lastmsg != msg: - self.msgqueueList.addItem(self.icchatinput.text()) - self.msgqueue.append(msg) - self.lastmsg = msg + self.msgqueueList.addItem(self.icchatinput.text()) + self.msgqueue.append(msg) + self.lastmsg = msg self.icchatinput.clear() self.realizationbtn.setPressed(False) @@ -1834,7 +1832,7 @@ class gui(QtGui.QWidget): if self.msgqueue: chatmsgcomp = (self.msgqueue[0].split('#')[5]).replace('', '$').replace('', '%').replace('', '&').replace('', '#') - if (chatmsgcomp == '>' or chatmsgcomp == '<') or (f_char_id == self.mychar and self.m_chatmessage[CHATMSG] == chatmsgcomp): # our message showed up + if (f_char_id == self.mychar and self.m_chatmessage[CHATMSG] == chatmsgcomp): # our message showed up del self.msgqueue[0] self.msgqueueList.takeItem(0) if self.additivebtn.isChecked(): @@ -3028,12 +3026,17 @@ class TCP_Thread(QtCore.QThread): error, total = self.parent.tcp.recv() if error == -2: + # if the message can't be sent, discard it + if sendtick == 4: + print '[warning] The server rejected the message' + del self.parent.msgqueue[0] + self.parent.msgqueueList.takeItem(0) continue elif error == -1: self.parent.emit(QtCore.SIGNAL('showMessage(QString, QString, QString)'), 'critical', 'Connection lost', "%s connection to server lost." % ("WebSocket" if self.parent.tcp.isWS else "TCP")) self.parent.willDisconnect = True self.quit() - return + return for network in total: header = network[0]