Added helper class for receiving data. Modified sender thread to support sending partial packets. Prepared abstractions for server state machine.

This commit is contained in:
lotodore
2007-03-13 02:23:12 +00:00
parent 29b29ec42e
commit f5289a6fcf
24 changed files with 508 additions and 70 deletions
@@ -94,10 +94,15 @@ void connectToServerDialogImpl::error(int errorID, int osErrorID) {
tr("Internal network error: \"recv\" failed."),
QMessageBox::Close); }
break;
case ERR_SOCK_SEND_FAILED:
{ QMessageBox::warning(this, tr("Network Error"),
tr("Internal network error: \"send\" failed."),
QMessageBox::Close); }
case ERR_SOCK_SEND_FAILED:
break;
case ERR_SOCK_CONN_RESET:
{ QMessageBox::warning(this, tr("Network Error"),
tr("Connection was closed by server."),
QMessageBox::Close); }
break;
default: { QMessageBox::warning(this, tr("Network Error"),
tr("DEFAULT ERROR"),
+2 -2
View File
@@ -88,5 +88,5 @@ void GuiWrapper::meInAction() const { myW->meInAction(); }
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); }
void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); }
void GuiWrapper::SignalNetClientSuccess(int actionID) { myW->SignalNetClientSuccess(actionID); }
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->SignalNetClientError(errorID, osErrorID); }
void GuiWrapper::SignalNetSuccess(int actionID) { myW->SignalNetSuccess(actionID); }
void GuiWrapper::SignalNetError(int errorID, int osErrorID) { myW->SignalNetError(errorID, osErrorID); }
+2 -2
View File
@@ -88,8 +88,8 @@ public:
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
void logNewGameHandMsg(int gameID, int handID) ;
void SignalNetClientSuccess(int actionID);
void SignalNetClientError(int errorID, int osErrorID);
void SignalNetSuccess(int actionID);
void SignalNetError(int errorID, int osErrorID);
private:
+2 -2
View File
@@ -480,8 +480,8 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
connect ( pushButton_break, SIGNAL( clicked()), this, SLOT ( breakButtonClicked() ) ); // auch wieder starten!!!!
//Nachrichten Thread-Save
connect(this, SIGNAL(SignalNetClientSuccess(int)), myConnectToServerDialog, SLOT(refresh(int)));
connect(this, SIGNAL(SignalNetClientError(int, int)), myConnectToServerDialog, SLOT(error(int, int)));
connect(this, SIGNAL(SignalNetSuccess(int)), myConnectToServerDialog, SLOT(refresh(int)));
connect(this, SIGNAL(SignalNetError(int, int)), myConnectToServerDialog, SLOT(error(int, int)));
// textBrowser_Log->append(QString::number(this->pos().x(),10)+" "+QString::number(this->pos().y(),10));
// textBrowser_Log->append(QString::number(this->x(),10)+" "+QString::number(this->y(),10));
+2 -2
View File
@@ -88,8 +88,8 @@ public:
void setSpeeds();
signals:
void SignalNetClientSuccess(int actionID);
void SignalNetClientError(int errorID, int osErrorID);
void SignalNetSuccess(int actionID);
void SignalNetError(int errorID, int osErrorID);
public slots: