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:
@@ -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"),
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user